AWS Lambda function for Node.js using TypeScript with ESM and ESBuild configured

AWS Lambda

Create a Lambda function for Node.js with ESM modules configured and ESBuild bundle set up

This sample project demonstrates how to use ES modules with a Lambda function using TypeScript, ESBuild and CDK.
This template has the bundle properly configured in CDK to use ES modules in Node.js for leveraging dynamic imports or top-level await for instance.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-node-esm-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Created by:

Luca Mezzalira

Luca Mezzalira

Luca Mezzalira is principal serverless specialist solutions architect at AWS, an international speaker, and books author. Over the past 20 years, he’s mastered software architectures from frontend to the cloud, providing the right solution for the context of the job at hand.

Follow on LinkedIn