In this tutorial, we’ll manually deploy a Node.js Express application to AWS Lambda. You will learn how to prepare your code, package it, upload to S3, and update the Lambda function. Afterwards, we’ll automate these steps using a Jenkins pipeline.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
AWS Resources Setup
First, ensure you have an Amazon S3 bucket and an existing AWS Lambda function.

Lambda Function Overview

| Parameter | Value |
|---|---|
| Name | solar-system-function |
| Package type | zip |
| Runtime | Node.js 20.x |
| Handler | app.handler |

Environment Variables
By default, MongoDB credentials are hardcoded. We’ll remove them when automating the pipeline.Avoid storing sensitive credentials in plain text. Use AWS Secrets Manager or secure environment variables.

Function URL and Application Version
This Lambda function has a public URL serving version 3.0 of the Solar System app.

CORS is enabled (
*) for public access.Manual Deployment Steps
Follow these steps to deploy your app:- Clone the repository.
- Adapt
app.jsfor AWS Lambda. - Install dependencies.
- Update
index.htmlversion. - Package the application.
- Upload the ZIP to S3.
- Update Lambda function code.
- Verify the deployment.
1. Clone the Repository
2. Configure app.js for AWS Lambda
Replace the Express listener with a Serverless handler.
Original at the end of app.js:
3. Install Dependencies
Ensureserverless-http is listed in package.json:
4. Update Application Version
ChangeSolar System 3.0 to Solar System 4.0:
5. Package the Application
Create the deployment ZIP:6. Upload the ZIP to S3
Upload to your Lambda bucket:
7. Update Lambda Function Code
Point your Lambda to the new S3 object:Sample Output
8. Verify the Deployment
Retrieve the function URL:Summary
- Replace
app.listenwith aserverless-httphandler. - Run
npm install. - Update the version in
index.html. - Zip the application files.
- Upload the ZIP to S3.
- Execute
aws lambda update-function-code. - Validate the new version via the function URL.