amazon-web-services - 由于配置错误 : Illegal character in path in Api Gataway,执行失败

标签 amazon-web-services amazon-s3 aws-api-gateway

我无法通过 Api Gataway 访问 S3。我订阅了以下模板:

 /s3:
        get:
          produces:
            - application/json
          parameters:
            - name: "key"
              in: "query"
              required: false
              type: "string"
          responses:
            "200":
              description: 200 response
          x-amazon-apigateway-integration:
            credentials:
              Fn::GetAtt:
                - ApiRole
                - Arn
            requestParameters:
              - integration.request.path.key: "method.request.querystring.key"

            uri: "arn:aws:apigateway:eu-west-1:s3:path/{key}"
            consumes:
                - application/json
            produces:
                - application/json
            responses:
              default:
                statusCode: '200'
            passthroughBehavior: when_no_match
            httpMethod: GET
            type: aws

但是当我检查工作时:

enter image description here

我收到一个错误:
Execution failed due to configuration error: Illegal character in path at index 35: https://s3-eu-west-1.amazonaws.com/{key} Thu Dec 13 22:46:03 UTC 2018 : Method completed with status: 500
集成请求中可能没有覆盖我的查询字符串。但我不知道如何正确地做到这一点。

最佳答案

我不确定这是否可行,但您可能希望将该 {s3} pathParam 更改为 {proxy+},从而将该 pathParam 转换为/'*' 通配符。
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-settings-method-request.html
祝你好运!

关于amazon-web-services - 由于配置错误 : Illegal character in path in Api Gataway,执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53771246/

相关文章:

amazon-web-services - CloudWatch 不会跨维度聚合您的自定义指标

hadoop - 在 Amazon EMR 上运行 Pig 字数统计脚本时出现错误

python - Apache Spark 读取 S3 : can't pickle thread. 锁对象

amazon-web-services - 如何调试 AWS Api 网关和 Lambda 的 "AWS/ApiGateway 5XXError"

amazon-web-services - AWS api 网关将不允许自定义域名关联到证书

amazon-web-services - AWS API Gateway 和 Elastic Cloud 托管的 Elasticsearch 之间的身份验证

mysql - AWS Mysql 5.5.40 安全组问题 强制更新

amazon-web-services - 在 s3 中重命名 Pyspark 输出文件

amazon-web-services - 使用 EMR 集群和来自其他账户的 s3 文件运行作业

aws-lambda - 无服务器框架将 Lambda 添加到现有 VPC 和子网