将二进制文件从api网关上传到S3存储桶 [英] upload binary from api gateway to S3 bucket
问题描述
我正在尝试创建一个rest api,该api可以将zip文件作为输入(PUT请求)并将其存储在S3上.
i was trying to create a rest api which can take zip file as input (PUT requst) and store that on S3.
我收到500个错误消息,cloudwatch日志如下
I'm getting 500 error ad the cloudwatch logs are as follows
验证请求的使用计划: c2140431-1a10-11e7-9f32-0df3853848fe. API密钥:API阶段: xjjd186a30/rd
Verifying Usage Plan for request: c2140431-1a10-11e7-9f32-0df3853848fe. API Key: API Stage: xjjd186a30/rd
已授权API密钥,因为方法'PUT/s3'不需要API密钥.
API Key authorized because method 'PUT /s3' does not require API Key.
请求不会增加限制或配额限制
Request will not contribute to throttle or quota limits
API密钥和API阶段xjjd186a30/rd的使用计划检查成功
Usage Plan check succeeded for API Key and API Stage xjjd186a30/rd
开始执行请求:c2140431-1a10-11e7-9f32-0df3853848fe
Starting execution for request: c2140431-1a10-11e7-9f32-0df3853848fe
HTTP方法:PUT,资源路径:/s3
HTTP Method: PUT, Resource Path: /s3
成功完成执行
方法已完成,状态为:500
Method completed with status: 500
当我尝试从邮递员那里获得api时
when i try the api from post man i get
AccessDenied
访问 DeniedF55D45C185A5BF11HXopfmxAxGNvmdi7PRp4c1j/wPYmGVTrkKbGXfZwofLOn7TRBPs3uFjer/2UCIktynKtGeNU1Xw =
AccessDenied
Access DeniedF55D45C185A5BF11HXopfmxAxGNvmdi7PRp4c1j/wPYmGVTrkKbGXfZwofLOn7TRBPs3uFjer/2UCIktynKtGeNU1Xw=
我的角色我已授予AmazonS3FullAccess权限,并已将该角色分配给api网关设置和集成请求.
my roles i have given AmazonS3FullAccess permission and have assigned the role to api gateway settings and the integration request.
任何人都可以帮忙
推荐答案
您似乎正在尝试将其放入名为rest
的存储桶.
那是正确的水桶吗?
It looks like you are attempting to put to the bucket named rest
.
Is that the correct bucket?
该文档可能会对您有所帮助: 将API与AWS S3集成
This documentation will probably be a little more helpful for you: Integrating API with AWS S3
在文档中使用的示例中,PUT项目方法的路径替代中提供了bucket
和object
.这些是从路径参数folder
和item
映射的.
In the example in used in the documentation, a bucket
and object
are provided in the path override for the PUT item method. These are mapped from the path params folder
and item
.
以下是有用的屏幕截图:
Here is a helpful screenshot:
这篇关于将二进制文件从api网关上传到S3存储桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!