Meaning of warning: You're using the LAMBDA-PROXY in combination with request / response configuration

I am new to Serverless, and i have following

handler: handler.hello
events:
  - http:
      path: v1/{id}
      method: post
      cors: true
      integration: lambda-proxy
      request:
          parameters:
              paths:
                id: true

And I am seeing following message so just wondering what does it mean.

Serverless: Warning! You're using the LAMBDA-PROXY in combination with request / response configuration in your function "hello". This configuration will be ignored during deployment.

Appreciate any guidance.

cheers

there are two types of integrations:

  1. lambda
  2. lambda-proxy (default and recommended)

see: https://serverless.com/framework/docs/providers/aws/events/apigateway

The difference is that with lambda you have to model your event object (request) and you are also quite limited regarding your response (dynamic headers, status codes, etc.)

With lambda-proxy a default event model is used which looks like this: https://github.com/bbilger/jrestless/tree/master/aws/gateway/jrestless-aws-gateway-handler#request-schema and you also have more freedom regarding responses but your response object must follow the schema: https://github.com/bbilger/jrestless/tree/master/aws/gateway/jrestless-aws-gateway-handler#response-schema

To make it short: either use lambda and “model” your request via the request parameter in your serverless.yml, or use lambda-proxy without the request parameter in your serverless.yml.

Internally serverless removes the request parameter when you use lambda-proxy, thus the warning.

2 Likes