Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gateway: Not defaulting to Lambda_Proxy integration type #6921

Open
mstig opened this issue Nov 4, 2019 · 0 comments
Open

API Gateway: Not defaulting to Lambda_Proxy integration type #6921

mstig opened this issue Nov 4, 2019 · 0 comments

Comments

@mstig
Copy link

mstig commented Nov 4, 2019

Bug Report

API Gateway no longer deploys with the default integration request set to Lambda_Proxy.

Description

Documentation states that the default Integration Request type is Lambda_Proxy, however this is not happening with recent versions of Serverless. No integration type is declared in the serverless yml file, however the default behavior is different depending on the Serverless version used.

With Serverless 1.32, the api deploys properly and uses the defaults per documentation, with 1.44 (intermediate versions have not been tested, first noticed this issue working/not working with 1.32 and 1.44) and higher.

Adding " integration: lambda_proxy " to the serverless.yml file causes the api gateway to set the type to Lambda_Proxy, but still retains the "Headers: X-Amz-Invocation-Type" setting that is being attached from the newer versions, and the API does not work.

  1. What did you do?
    Deployed Lambda Functions with http events tied to API Gateway

  2. What happened?

image
The Integration Request was not properly applied, and does not use the Lambda_Proxy setting that is listed as the default within the serverless documentation.

Adding "integration: lambda_proxy" adjusts the type setting, but retains a header that still causes errors when using the api.

  1. What should've happened?

image

The integration type should've been set to LAMBDA_PROXY with no headers.

  1. What's the content of your serverless.yml file?
    functions:
    fnName:
    handler: api/handler.function
    memorySize: 256
    events:
    • http:
      path: invoice/upload/v2.0
      method: post
      async: true
      authorizer:
      arn: ${self:custom.authorizeFunction.${self:provider.stage}}
      resultTtlInSeconds: 0
      type: request
      integration: lambda_proxy # This was only added after the fact, does not fix the issue
      cors:
      origin: ${self:custom.corsOrigin.${self:provider.stage}}
      headers:
      - Content-Type
      - X-Amz-Date
      - Authorization
      - authorization
      - X-Api-Key
      - X-Amz-Security-Token
      - X-Amz-User-Agent
      - cache-control
      allowCredentials: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants