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);
interface LambdaInterface {
    handler: SyncHandler<Handler> | AsyncHandler<Handler>;
}

Properties

Properties

handler: SyncHandler<Handler> | AsyncHandler<Handler>