Writing AWS Lambda functions with Typescript and Webpack

Click for: original source

Whether you use terraform, the terraform cdk or the aws cdk, you still need to compile your source code and make them into lambda deployment packages. By Julian.

A lambda deployment package is a ZIP file that contains the source code for the lambda function. At it’s most basic a deployment package has one file in it. This file will contain a handler. Regardless of which IAC tool you use you will need to define the name of the handler which consists of the filename (minus the file extension) and the handler function inside the file.

In this article we are going to use webpack to compile our lambdas and bundle everything including modules into one compressed file. Folder structure and code for webpack is explained and provided as a gist in this repository. Good read!

[Read More]

Tags nodejs javascript serverless frontend web-development