Bundling an AWS Lambda function using webpack

To run a function on AWS Lambda you create a deployment package that contains the function code and its dependencies. In this post, I show how to use webpack to ensure that the deployment package for a Node.js Lambda function is as small as possible. Naive packaging The simplest way to create a deployment package is to ZIP the function code alongside its runtime dependencies. The directory structure to package for a typical Node.js Lambda function looks like: ...

4 August, 2020 · Max Smolens

Debugging lost output from a child process in Node.js

I recently encountered an issue in a Node.js v12 service where output streamed from a child process is intermittently missing from downstream processing. The pipeline streams the data into a ZIP archive and uploads it to S3. The service is deployed on AWS Lambda. In this post, I describe the problem, walk through the debugging process, and evaluate several solutions. Data pipeline At a high level, the data pipeline inside the Lambda function looks like: ...

1 July, 2020 · Max Smolens