Ensure IntegrationHttpMethod
is set to POST
even if you want to use a GET
(or whatever)
e.g.
rootMethod:
Type: AWS::ApiGateway::Method
Properties:
AuthorizationType: NONE
HttpMethod: GET
Integration:
IntegrationHttpMethod: POST
Type: AWS_PROXY
Uri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${lambdaArn}/invocations"
ResourceId: !GetAtt apiGateway.RootResourceId
RestApiId: !Ref apiGateway
See this thread: https://forums.aws.amazon.com/thread.jspa?messageID=745275
When attempting to set up an API Gateway with a single endpoint that used a Lambda we continually got the following
error message when attempting to use GET
methods:
<AccessDeniedException>
<Message>Unable to determine service/operation name to be authorized</Message>
</AccessDeniedException>
This was apparently due to the fact that regardless of the actual HttpMethod
we set, IntegrationHttpMethod
needs to be set to POST
as per this piece of AWS documentation:
For Lambda integrations, you must use the HTTP method of POST for the integration request, according to the specification of the Lambda service action for function invocations.