} lambdaPath: string } export class LambdaApi extends cdk.Construct { public readonly handler: lambda.Function public readonly api: apigateway.LambdaRestApi constructor(scope: cdk.Construct, id: string, { environment, lambdaPath }: LambdaApiProps) { super(scope, id) this.handler = new lambda.Function(this, `${id}Handler`, { runtime: lambda.Runtime.NODEJS_12_X, code: lambda.Code.asset(lambdaPath), handler: 'index.handler', environment }) this.api = new apigateway.LambdaRestApi(this, `${id}Endpoint`, { handler: this.handler }) } }