Search code examples
node.jsamazon-web-servicesaws-lambdaaws-api-gatewayaws-cdk

What do i put in the "handler" prop of aws-cdk's gateway.LambdaRestApi?


I'm building out one of my first gateway api's and have been reading the code and documentation here.

For an apigateway which use made using the LambdaRestApi function, my understanding was that i define the endpoints and the lambda attached to the endpoints.

If that's the case, what do i put as the functions handler function? I don't have any plans for there to be a base route for it so do i have to just have a blank lambda here? Or am i going in the wrong direction with my thinking?


Solution

  • LambdaRestApi is just a utility construct based on RestApi with defaultIntegration to a Lambda function.

    You can use a plain RestApi instead if you don't need the default proxy integration to a Lambda handler configured.