AWS Security ChangesHomeSearch

AWS lambda documentation change

Service: lambda · 2025-05-10 · Documentation low

File: lambda/latest/dg/nodejs-layers.md

Summary

Updated Node.js runtime references from version 20 to 22, including directory paths, runtime specifications, and CLI commands.

Security assessment

The changes reflect a routine update to the Node.js runtime version (20 to 22) for Lambda layers. There is no explicit mention of security vulnerabilities, patches, or security feature enhancements. This is a standard documentation update for compatibility with newer runtime versions.

Diff

diff --git a/lambda/latest/dg/nodejs-layers.md b/lambda/latest/dg/nodejs-layers.md
index 75e573bbd..191b5e39d 100644
--- a//lambda/latest/dg/nodejs-layers.md
+++ b//lambda/latest/dg/nodejs-layers.md
@@ -43 +43 @@ To follow the steps in this section, you must have the following:
-  * [Node.js 20](https://nodejs.org/en/blog/release/v20.9.0) and the [npm](https://www.npmjs.com/) package manager. For more information about installing Node.js, see [Installing Node.js via package manager](https://nodejs.org/en/download/package-manager/) in the Node.js documentation.
+  * [Node.js 22](https://nodejs.org/en/blog/release/v22.11.0) and the [npm](https://www.npmjs.com/) package manager. For more information about installing Node.js, see [Installing Node.js via package manager](https://nodejs.org/en/download/package-manager/) in the Node.js documentation.
@@ -50 +50 @@ To follow the steps in this section, you must have the following:
-Throughout this topic, we reference the [layer-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/layer-nodejs) sample application in the _aws-lambda-developer-guide_ GitHub repository. This application contains scripts that download a dependency and package it into a layer. The application also contains corresponding functions that use the dependency from the layer. After creating a layer, you can deploy and invoke the corresponding function to verify that everything works. This sample application uses the Node.js 20 runtime. If you add additional dependencies to your layer, they must be compatible with Node.js 20.
+Throughout this topic, we reference the [layer-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/layer-nodejs) sample application in the _aws-lambda-developer-guide_ GitHub repository. This application contains scripts that download a dependency and package it into a layer. The application also contains corresponding functions that use the dependency from the layer. After creating a layer, you can deploy and invoke the corresponding function to verify that everything works. This sample application uses the Node.js 22 runtime. If you add additional dependencies to your layer, they must be compatible with Node.js 22.
@@ -58 +58 @@ When you package code in a Node.js layer, you specify the Lambda runtime environ
-Lambda Node.js runtimes specify their Node.js version and operating system. In this document, you will use the Node.js 20 runtime, which is based on AL2023. For more information about runtime versions, see [Supported runtimes](./lambda-runtimes.html#runtimes-supported). When you create a Lambda function, you specify the instruction set architecture. In this document, you will use the `arm64` architecture. For more information about architectures in Lambda, see [Selecting and configuring an instruction set architecture for your Lambda function](./foundation-arch.html).
+Lambda Node.js runtimes specify their Node.js version and operating system. In this document, you will use the Node.js 22 runtime, which is based on AL2023. For more information about runtime versions, see [Supported runtimes](./lambda-runtimes.html#runtimes-supported). When you create a Lambda function, you specify the instruction set architecture. In this document, you will use the `arm64` architecture. For more information about architectures in Lambda, see [Selecting and configuring an instruction set architecture for your Lambda function](./foundation-arch.html).
@@ -82 +82 @@ For example, the resulting layer .zip file that you create in this tutorial has
-        └ node20
+        └ node22
@@ -88 +88 @@ For example, the resulting layer .zip file that you create in this tutorial has
-You will put the [`lodash`](https://www.npmjs.com/package/lodash) library in the `nodejs/node20/node_modules` directory. This ensures that Lambda can locate the library during function invocations.
+You will put the [`lodash`](https://www.npmjs.com/package/lodash) library in the `nodejs/node22/node_modules` directory. This ensures that Lambda can locate the library during function invocations.
@@ -128 +128 @@ This script runs `npm install`, which reads your `package.json` and downloads th
-This script copies the contents from the `node_modules` directory into a new directory named `nodejs/node20`. It then zips the contents of the `nodejs` directory into a file named `layer_content.zip`. This is the .zip file for your layer. You can unzip the file and verify that it contains the correct file structure, as shown in the Layer paths for Node.js runtimes section. 
+This script copies the contents from the `node_modules` directory into a new directory named `nodejs/node22`. It then zips the contents of the `nodejs` directory into a file named `layer_content.zip`. This is the .zip file for your layer. You can unzip the file and verify that it contains the correct file structure, as shown in the Layer paths for Node.js runtimes section. 
@@ -132,2 +132,2 @@ This script copies the contents from the `node_modules` directory into a new dir
-        mkdir -p nodejs/node20
-    cp -r node_modules nodejs/node20/
+        mkdir -p nodejs/node22
+    cp -r node_modules nodejs/node22/
@@ -141 +141 @@ This script copies the contents from the `node_modules` directory into a new dir
-Take the `layer_content.zip` file that you generated in the previous section and upload it as a Lambda layer. You can upload a layer using the AWS Management Console or the Lambda API via the AWS Command Line Interface (AWS CLI). When you upload your layer .zip file, in the following [PublishLayerVersion](https://docs.aws.amazon.com/lambda/latest/api/API_PublishLayerVersion.html) AWS CLI command, specify `nodejs20.x` as the compatible runtime and `arm64` as the compatible architecture.
+Take the `layer_content.zip` file that you generated in the previous section and upload it as a Lambda layer. You can upload a layer using the AWS Management Console or the Lambda API via the AWS Command Line Interface (AWS CLI). When you upload your layer .zip file, in the following [PublishLayerVersion](https://docs.aws.amazon.com/lambda/latest/api/API_PublishLayerVersion.html) AWS CLI command, specify `nodejs22.x` as the compatible runtime and `arm64` as the compatible architecture.
@@ -146 +146 @@ Take the `layer_content.zip` file that you generated in the previous section and
-        --compatible-runtimes nodejs20.x \
+        --compatible-runtimes nodejs22.x \
@@ -208 +208 @@ The sample [function code](https://github.com/awsdocs/aws-lambda-developer-guide
-        --runtime nodejs20.x \
+        --runtime nodejs22.x \