AWS API Gateway with proxy-integration by serverless.yml

41 Views Asked by At

I'm wondering how to set API Gateway with proxy-integration by serverless.yml (the "Lambda proxy integration" switch)

the proxy-integration switch

In serverless document, I can't find any description about this setting.

And this is my code:

functions:
  lambda_func:
    image: my_image
    timeout: 300
    environment:
      STAGE: ${self:provider.stage}
    events:
      - http:
          path: lambda_func
          method: post
          async: true

I have tried to add 'integration: lambda' to the events config, but it doesn't work.

1

There are 1 best solutions below

0
Larson Kao On BEST ANSWER

finally, I find the answer.

functions:
  lambda_func:
    image: my_image
    timeout: 300
    environment:
      STAGE: ${self:provider.stage}
    events:
      - http:
          path: lambda_func
          method: post
          async: true
          integration: lambda-proxy # have to add this line