Export Layer
1. Get the Layer ARN
Ensure you have the full ARN of the Lambda Layer. It typically looks like:
arn:aws:lambda:<region>:<account-id>:layer:<layer-name>:<version>
For example:
arn:aws:lambda:us-east-1:123456789012:layer:my-nodejs-layer:3
2. Download the Layer Using AWS CLI
You can use the AWS CLI to download the Lambda Layer as a ZIP file:
aws lambda get-layer-version-by-arn --arn <layer-arn> --query 'Content.Location' --output text
This command returns a pre-signed URL to download the layer. Use curl or wget to download it:
curl -o nodejs-layer.zip "<download-url>"
3. Extract the Layer
Unzip the downloaded file:
unzip nodejs-layer.zip -d nodejs-layer
4. Inspect the Directory Structure
For Node.js 18, the Lambda Layer typically follows this structure:
nodejs-layer/
└── nodejs/
├── node_modules/
└── package.json
- nodejs/: The directory containing the Node.js libraries.
- node_modules/: The installed dependencies.
- package.json: The package manifest file.
If the layer contains native binaries or other resources, they might be located in additional directories within the ZIP file.