Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AWS API网关错误:API网关没有将提供的角色作为S3代理的权限_Api_Amazon Web Services_Amazon S3_Aws Api Gateway - Fatal编程技术网

AWS API网关错误:API网关没有将提供的角色作为S3代理的权限

AWS API网关错误:API网关没有将提供的角色作为S3代理的权限,api,amazon-web-services,amazon-s3,aws-api-gateway,Api,Amazon Web Services,Amazon S3,Aws Api Gateway,也有类似的问题,但它们都有我尝试过的答案。 我不确定我可能做错了什么,但任何帮助都将不胜感激 测试详情: 方法执行测试产生的错误;提交请求: Execution log for request test-request Mon Oct 16 10:13:47 UTC 2017 : Starting execution for request: test-invoke-request Mon Oct 16 10:13:47 UTC 2017 : HTTP Method: PUT, Resourc

也有类似的问题,但它们都有我尝试过的答案。 我不确定我可能做错了什么,但任何帮助都将不胜感激

测试详情:

方法执行测试产生的错误;提交请求:

Execution log for request test-request
Mon Oct 16 10:13:47 UTC 2017 : Starting execution for request: test-invoke-request
Mon Oct 16 10:13:47 UTC 2017 : HTTP Method: PUT, Resource Path: /pop-data-xmlz/test.xml
Mon Oct 16 10:13:47 UTC 2017 : Method request path: {item=test.xml, folder=pop-data-xmlz}
Mon Oct 16 10:13:47 UTC 2017 : Method request query string: {}
Mon Oct 16 10:13:47 UTC 2017 : Method request headers: {Content-Type=application/xml}
Mon Oct 16 10:13:47 UTC 2017 : Method request body before transformations: <test>
test string
</test>
Mon Oct 16 10:13:47 UTC 2017 : Request validation succeeded for content type application/json
Mon Oct 16 10:13:47 UTC 2017 : Execution failed due to configuration error: API Gateway does not have permission to assume the provided role
Mon Oct 16 10:13:47 UTC 2017 : Method completed with status: 500
请求测试请求的执行日志 2017年10月16日星期一10:13:47 UTC:开始执行请求:测试调用请求 2017年10月16日星期一10:13:47 UTC:HTTP方法:PUT,资源路径:/pop数据xmlz/test.xml 2017年10月16日星期一10:13:47 UTC:方法请求路径:{item=test.xml,folder=pop data xmlz} 2017年10月16日星期一10:13:47 UTC:方法请求查询字符串:{} 2017年10月16日星期一10:13:47 UTC:方法请求头:{Content Type=application/xml} 2017年10月16日星期一10:13:47 UTC:转换前的方法请求正文: 测试字符串 2017年10月16日星期一10:13:47 UTC:内容类型应用程序/json的请求验证成功 2017年10月16日星期一10:13:47 UTC:由于配置错误,执行失败:API网关无权担任提供的角色 2017年10月16日星期一10:13:47 UTC:方法已完成,状态:500 我正在学习S3教程()的API网关,并尝试执行PUT请求

API网关位于us-east-1中,S3存储桶位于us-east-2中

创建的角色:APIGatewayProxyCustom

附加了一个策略(pop日期摄取),允许将请求放入S3存储桶。

角色具有信任关系集:

要解决此问题,请转到IAM中您的角色定义,并选择信任关系选项卡。从这里编辑Principal Service加载项
apigateway.amazonaws.com
,如下所示

这将授予API网关除现有Lambda权限外,还可以担任运行函数的角色

{
“版本”:“2012-10-17”,
“声明”:[
{
“效果”:“允许”,
“委托人”:{
“服务”:[“apigateway.amazonaws.com”、“lambda.amazonaws.com”]
},
“操作”:“sts:假定角色”
}
]

}
非常感谢!阻止我发疯。官方文件再次没有提到这一点,这对他们来说非常糟糕!欢迎@clivesargant。很高兴知道这有帮助:)谢谢@VijayanathViswanathan。非常有帮助。但在问题中,我看到了同一个JSON的信任关系。非常感谢您对AWS用户的帮助!