The type of integration must be set to AWS_PROXY . The following is an example of a method fragment from the CloudMormation YAML working template.
ProxyResourceAny: Type: AWS::ApiGateway::Method Properties: AuthorizationType: NONE HttpMethod: ANY ResourceId: Ref: ProxyResource RestApiId: Ref: API Integration: Type: AWS_PROXY IntegrationHttpMethod: POST Uri: !Sub - arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${Arn}/invocations - Arn: Fn::GetAtt: - RestorerLambda - Arn
Itβs worth saying, as I understand it ...
While scratching my head for a while, I examined the output of the aws apigateway get-method CLI command for a method that was configured this way using the console. This gave me the following JSON, and I realized that the flag could be encoded into a type. I tested my assumption and came up with CloudFormation above.
{ "apiKeyRequired": false, "httpMethod": "ANY", "methodIntegration": { "integrationResponses": { "200": { "responseTemplates": { "application/json": null }, "statusCode": "200" } }, "passthroughBehavior": "WHEN_NO_MATCH", "cacheKeyParameters": [], "uri": "arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:XXXXXXXXX:function:Shildrew-Restorer-Play-Lambda/invocations", "httpMethod": "POST", "cacheNamespace": "64bl3tgw4g", "type": "AWS_PROXY" }, "requestParameters": {}, "authorizationType": "NONE" }
sihil
source share