简体   繁体   English

使用Api Gateway代理从S3获取文件列表

[英]Get file list from S3 using Api Gateway proxy

Im trying to get list of files from S3 bucket using ApiGateway. 我试图使用ApiGateway从S3存储桶中获取文件列表。 How should look my GET request from ApiGateWay ? 我应该如何看待ApiGateWay的GET请求?

If you want to use API Gateway as the proxy to S3, probably the best way how to start is to import an example API provided by AWS: 如果要使用API​​ Gateway作为S3的代理,可能的最佳启动方法是导入AWS提供的示例API:

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-as-s3-proxy-export-swagger-with-extensions.html https://docs.aws.amazon.com/apigateway/latest/developerguide/api-as-s3-proxy-export-swagger-with-extensions.html

the only thing you have to do is to replace the ARN of role in the json, ie replace all "arn:aws:iam::123456789012:role/apigAwsProxyRole" with your own role ARN (don't forget to provide the proper permissions to role through IAM console) 唯一要做的就是替换json中角色的ARN,即用您自己的角色ARN替换所有“ arn:aws:iam :: 123456789012:role / apigAwsProxyRole”(不要忘记提供适当的权限通过IAM控制台角色)

Once this is done just import the file through API Gateway console. 完成此操作后,只需通过API Gateway控制台导入文件即可。 It will create you a new API called MyS3 where the GET method you looking for looks like this. 它将为您创建一个名为MyS3的新API,其中您要查找的GET方法如下所示。

AWS API Gateway控制台

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM