Alex Johnston
Alex Johnston

Reputation: 99

Cloudformation API Gateway Use Lambda Proxy integration

I have looked at previous posts and the information supplied does not resolve my issue.

When using the UI there is a tick box for "Use Lambda Proxy integration"

This is my cloudformation method:

ProxyCreateUser:
Type: AWS::ApiGateway::Method
Properties:
  RestApiId:
    Ref: MyRestAPI
  ResourceId:
    Ref: CreateUser
  HttpMethod: POST
  AuthorizationType: NONE
  Integration:
    Type: AWS_PROXY
    IntegrationHttpMethod: POST
    Uri: !Sub arn...
    PassthroughBehavior: "WHEN_NO_TEMPLATES"
  MethodResponses:
    - StatusCode: 200
    - StatusCode: 400
    - StatusCode: 401
    - StatusCode: 403
    - StatusCode: 404
    - StatusCode: 409
    - StatusCode: 500

Is there a way to untick this box in cloudformation? Or is there going to have to be manual intervention every time?

If you need anymore information let me know.

Thank you.

Upvotes: 1

Views: 879

Answers (1)

Alex Johnston
Alex Johnston

Reputation: 99

I have seen other people in different forums struggling with this too.

After working out how to do it through the aws cli I stumbled across a mistake which everyone hitting this same issue seems to have.

Integration:
Type: AWS_PROXY

Needs to be altered to:

Integration:
Type: AWS

The cloud formation documentation currently is scarce and the API gateway cloudformation documentation doesn't match up to what can be seen on the console which hinders anyone who is trying to resolve an issue.

Upvotes: 1

Related Questions