将二进制文件从api网关上传到S3存储桶 [英] upload binary from api gateway to S3 bucket

查看:123
本文介绍了将二进制文件从api网关上传到S3存储桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个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.

我正在关注 http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-content-encodings-examples-image-s3.html

我收到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 =

AccessDeniedAccess 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项目方法的路径替代中提供了bucketobject.这些是从路径参数folderitem映射的.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆