1
votes

I have APIs configured in AWS API gateway (few with lambda integration and few with lambda proxy integration).

We have decided to go ahead only with lambda proxy integration as it is easy to deploy and maintain. Have exported json file using "Swagger + API Gateway Extensions".

How to identify which endpoints uses lambda integrations from the json file. Do we have to manually open each endpoint in API Gateway UI and check if it has lambda proxy enabled or there is a better way to identify?

Thanks.

1

1 Answers

0
votes

If you look in the Swagger file with custom extensions, each endpoint/method should have a property called x-amazon-apigateway-integration. Underneath that there will be another property named type.

The value for endpoints without Lambda Proxy Integration will be aws and the lambdas with Proxy Integration will be aws_proxy

paths:
   # This is not a lambda proxy integration
  /v1/noproxy:
    get:
      produces:
      - "application/json"
      responses: {}
      x-amazon-apigateway-integration:
        uri: "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:****:function:***/invocations"
        responses:
          default:
            statusCode: "200"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        contentHandling: "CONVERT_TO_TEXT"
        type: "aws"

  # This is a lambda proxy integration
  /v1/myproxyintegration:
    post:
      responses: {}
      security:
      - sigv4: []
      x-amazon-apigateway-integration:
        uri: "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:*****:function:***/invocations"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        type: "aws_proxy"