Help us improve the AWS re:Post Knowledge Center by sharing your feedback in a brief survey. Your input can influence how we create and update our content to better support your AWS journey.
CloudFormation 템플릿 또는 OpenAPI 정의를 사용하여 Lambda 통합이 포함된 REST API를 생성했습니다. API Gateway에서 “Execution failed” 오류가 발생하는 이유는 무엇입니까?
4분 분량
0
AWS CloudFormation 템플릿을 사용하여 AWS Lambda 통합을 포함하는 Amazon API Gateway REST API를 생성했습니다. API 메서드를 사용하여 Lambda 함수를 호출하면 오류 메시지와 500 상태 코드가 표시됩니다.
Mon Oct 14 14:08:49 UTC 2019 : Received response. Status: 403, Integration latency: 3 msMon Oct 14 14:08:49 UTC 2019 : Endpoint response headers: {Date=Mon, 14 Oct 2019 14:08:49 GMT, Content-Length=130, Connection=keep-alive, x-amzn-RequestId=abc1d2ef-34ab-56c7-de8f-90123a456789}
Mon Oct 14 14:08:49 UTC 2019 : Endpoint response body before transformations: <AccessDeniedException>
<Message>Unable to determine service/operation name to be authorized</Message>
</AccessDeniedException>
Mon Oct 14 14:08:49 UTC 2019 : Lambda invocation failed with status: 403. Lambda request id: abc1d2ef-34ab-56c7-de8f-90123a456789
Mon Oct 14 14:08:49 UTC 2019 : Execution failed due to configuration error:
Mon Oct 14 14:08:49 UTC 2019 : Method completed with status: 500
백엔드 통합 요청에 대한 HTTP 메서드를 POST로 변경하는 데 사용하는 방법은 원래 템플릿 정의에 따라 다릅니다. CloudFormation에서 배포한 API Gateway를 업데이트하는 프로세스는 OpenAPI에서 생성한 API Gateway를 업데이트하는 프로세스와 다릅니다.
CloudFormation에서 생성된 API Gateway
CloudFormation에서 생성된 API Gateway의 경우 스택 템플릿을 업데이트해야 합니다. CloudFormation 템플릿에서 AWS::ApiGateway::Method 리소스를 정의하여 메서드를 생성한 경우, HttpMethod 속성을 POST로 업데이트하십시오. 지침은 예제를 참조하십시오.
메서드에서 AWS::ApiGateway::RestAPI 리소스의 Body 속성에 대해 OpenAPI 정의를 사용하는 경우, API 정의 파일의 httpMethod를 POST로 설정하십시오. 지침은 x-amazon-apigateway-integration 객체를 참조하십시오. 또한 aws-samples GitHub 리포지토리의 예제 Swagger 템플릿을 참조하십시오.