An interface that represents an object-oriented Lambda handler.
import type { Context } from 'aws-lambda';import type { LambdaInterface } from '@aws-lambda-powertools/commons/types';class Lambda implements LambdaInterface { public handler = async (event: unknown, context: Context) => { // Your handler code here }}const handlerClass = new Lambda();export const handler = lambda.handler.bind(lambda); Copy
import type { Context } from 'aws-lambda';import type { LambdaInterface } from '@aws-lambda-powertools/commons/types';class Lambda implements LambdaInterface { public handler = async (event: unknown, context: Context) => { // Your handler code here }}const handlerClass = new Lambda();export const handler = lambda.handler.bind(lambda);
An interface that represents an object-oriented Lambda handler.
Example