【发布时间】:2018-10-31 04:00:22
【问题描述】:
我正在尝试在 Api Gateway 上创建一个端点,该端点使用 data/$timestamp 之类的文件名写入 AWS s3 存储桶,其中时间戳是每个请求中应该可用的 $context.requestTimeEpoch 变量
我的api网关请求集成是这样的
{
"type": "AWS",
"httpMethod": "PUT",
"uri": "arn:aws:apigateway:eu-west-1:bucketname.s3:path/data/{reqTimestamp}",
"credentials": "arn:aws:iam::xxxxx:role/ApiGatewayWriteToDemoS3Bucket",
"requestParameters": {
"integration.request.path.reqTimestamp": "context.requestTime"
},
"passthroughBehavior": "WHEN_NO_MATCH",
"timeoutInMillis": 29000,
"cacheNamespace": "5f92eajcg9",
"cacheKeyParameters": [],
"integrationResponses": {
"200": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Access-Control-Allow-Origin": "'*'"
},
"responseTemplates": {
"application/json": null
}
}
}
}
但是我得到了这个错误
Execution failed due to configuration error: Illegal character in path at index 49: https://bucketname.s3-eu-west-1.amazonaws.com/data/{reqTimestamp}
它只工作了一次,然后我遇到了 S3 身份验证错误,但这是另一回事
【问题讨论】:
标签: amazon-web-services aws-api-gateway