Anatomy of the Lambda function when used in Lambda proxy integration

In Lambda integration, because the Lambda function and the API are decoupled, the Lambda function handler can implement the RequestHandler<INPUT,OUTPUT> interface with INPUT and OUTPUT being any types that are transformed and sent by the API Gateway. In fact, the Lambda function that we saw in the previous section is a valid candidate as a Lambda function for Lambda integration.

For Lambda proxy integration, since INPUT and OUTPUT conform to a particular format, the handler function needs to respect that.

In the case of Lambda proxy integration, the handler function is as follows:

.class Handler : RequestHandler<Map<String, Any>, ApiGatewayResponse> {    override  fun handleRequest(input: ...

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.