2017-10-16 1 views
1

비슷한 질문이 있지만 답변을 얻었습니다. 내가 뭘 잘못하고 있지만 도움이 될지 모르겠다.AWS API 게이트웨이 오류 : API 게이트웨이에 제공된 역할을 S3 프록시로 가정 할 수있는 권한이 없습니다.

테스트 정보 : enter image description here

방법 실행시의 검사에서 에러; PUT 요청 :

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 

내가 S3 튜토리얼 (http://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html)에 API 게이트웨이 다음과 PUT 요청을 실행하려고 시도하고있다.

API 게이트웨이는 us-east-1에 있고 S3 버킷은 us-east-2에 있습니다.

작성된 역할 : APIGatewayProxyCustom

정책 (POP 최신 인제)를 S3 버킷에 PUT 요청을 허용하는 부착된다. enter image description here

답변

8

이 당신의 IAM의 역할에 가서 "신뢰 관계"탭을 선택 수정하려면 : enter image description here

역할은 신뢰 관계의 집합이 있습니다. 여기에서 정책을 편집하고 주 서비스에 대해 아래에 표시된 "apigateway.amazonaws.com"을 추가하십시오. 이렇게하면 API 게이트웨이에 기존 람다 권한 외에도 기능을 실행하는 역할을 맡을 수있는 권한이 부여됩니다.

{ 
 
"Version": "2012-10-17", 
 
"Statement": [ 
 
{ 
 
"Effect": "Allow", 
 
"Principal": { 
 
"Service": ["apigateway.amazonaws.com","lambda.amazonaws.com"] 
 
}, 
 
"Action": "sts:AssumeRole" 
 
} 
 
] 
 
}

+1

정말 감사합니다! 미쳐 버린 걸 멈췄다. 다시 한번 공식 문서는 이것을 언급하지 않는다. –

+0

당신은 @CliveSargeant를 환영합니다. 그것이 도움이된다는 것을 아는 것이 좋습니다 :) –

+0

고마워요 !! !!!! –

관련 문제