Menu

1 / 5

How to Deploy NestJS to AWS Lambda Using CDK and GitHub Actions

DEV Community·Ajeet Chaulagain·6 months ago
#z9wB5muH
#deploying#lambda#nestjs#aws#code
Reading 0:00
15s threshold

Originally published on ajeetchaulagain.com on March 30, 2026.

Deploying a NestJS application to AWS Lambda behind API Gateway sounds straightforward — until you start wiring things together.

Between adapting NestJS to a serverless runtime, configuring API Gateway , and setting up infrastructure with AWS CDK , there are several moving parts that can quickly become messy. While working on a personal side project, I ran into these challenges firsthand — particularly around adapting NestJS to Lambda's execution model.

By the end of this guide, you'll have:

A NestJS app adapted for Lambda's execution model using @codegenie/serverless-express

Infrastructure defined as code: a Lambda function and HTTP API Gateway, provisioned with AWS CDK

A GitHub Actions workflow that builds and deploys your stack automatically on every push to main

The complete source code is available on GitHub .

Prerequisites

To follow along, you'll need:

An AWS account

Basic familiarity with Node.js and NestJS

Basic familiarity…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.