This README outlines the steps to update an existing AWS Lambda function by zipping and uploading a new version of the Node.js code.
- Ensure AWS CLI is installed and configured:
aws --version aws configure
If not installed, follow the guide here
-
Navigate to the directory containing your Node.js code.
cd /path/to/your/lambda-function
-
Zip the contents of the folder, including dependencies.
zip -r my-lambda-function.zip .
- Use the AWS CLI to update the Lambda function with the new zip file. Replace
your-function-name
with the name of your Lambda function.aws lambda update-function-code \ --function-name your-function-name \ --zip-file fileb://my-lambda-function.zip
Now, your AWS Lambda function should be updated with the new code. You can go to the AWS Lambda console to perform any tests or check logs for further verification.