AWS Lambda Layer CLI Tool
A command-line tool for creating and publishing AWS Lambda layers for Node.js and Python.
Features
- Effortless Publishing: Create and publish Node.js and Python layers in a single command
- Smart Compatibility: Auto-selects the right Linux binaries for Amazon Linux 2 or 2023
- Cross-Architecture: Native support for
x86_64andarm64builds - Auto-Versioning: Automatically handles layer naming and version increments
Installation
Package Managers (Recommended)
npm (Node.js)
npm i -g aws-lambda-layer-cli
uv (Python)
uv tool install aws-lambda-layer-cli
Requirements
- System: Linux, macOS, or Windows (WSL recommended)
- Tools:
zip,aws-cli(for publishing),node(for Node.js layers),python(for Python layers)
Usage
aws-lambda-layer-cli <command> [options]
Commands
zip: Create a local zip filepublish: Create and publish a layer to AWScompletion: Generate shell completion scriptsuninstall: Uninstall the toolhelp: Show help message
Options
| Option | Description |
|---|---|
--nodejs, -n <pkgs> |
Create Node.js layer (comma-separated packages) |
--python, -p <pkgs> |
Create Python layer (comma-separated packages) |
--wheel, -w <file> |
Use with --python to create layer from .whl file |
--name |
Custom layer name |
--description |
Layer description (publish only) |
--profile |
AWS CLI profile (publish only) |
--region |
AWS region (publish only) |
--architecture, -a |
Target architecture (x86_64 or arm64) |
--node-version |
Node.js version (default: 24) |
--python-version |
Python version (default: 3.14) |
-v, --version |
Show version |
Examples
Node.js
# Create local zip with multiple packages
aws-lambda-layer-cli zip --nodejs express@4.18.2,axios --name my-layer
# Publish to AWS with specific profile and region
aws-lambda-layer-cli publish --nodejs lodash --profile prod --region us-east-1 --description "Utils"
Python
# Create local zip with specific python version and architecture
aws-lambda-layer-cli zip --python numpy==1.26.0,pandas --python-version 3.12 --architecture arm64
# Publish to AWS for ARM64 architecture
aws-lambda-layer-cli publish --python requests --name web-layer --architecture arm64
Note: This tool automatically selects the optimal platform based on the Python version:
- Python 3.12+ (Amazon Linux 2023): Targets
manylinux_2_28(GLIBC 2.28+)- Python 3.11- (Amazon Linux 2): Targets
manylinux2014(GLIBC 2.17+)
Wheel File
The tool auto-detects Python version and architecture from the wheel filename.
# Create local zip from wheel (preferred syntax)
aws-lambda-layer-cli zip --python --wheel numpy-2.4.1-cp313-cp313-manylinux.whl
# Publish directly from wheel
aws-lambda-layer-cli publish --python --wheel pandas-2.1.0-cp311-...-x86_64.whl
Note: For wheels, arguments like
--python-versionor--architectureare checked against the wheel metadata. If they conflict, the tool will error to prevent incompatibility.
Shell Completion
Add to your shell config (~/.bashrc or ~/.zshrc):
# Bash
source <(aws-lambda-layer-cli completion --bash)
# Zsh
source <(aws-lambda-layer-cli completion --zsh)
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for aws-lambda-layer-cli 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aws_lambda_layer_cli-2.2.0.tar.gz | 26.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aws_lambda_layer_cli-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.8 kB
Release files / aws_lambda_layer_cli-2.2.0.tar.gz
| Download URL | aws_lambda_layer_cli-2.2.0.tar.gz |
|---|---|
| Size | 26.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3c21cc05246b4f213d930db059cd91cc865d3aa69afd9b249641c94577212d6
|
|
BLAKE2b-256 checksum How to use checksums |
82b905d97e33ba287b386b6737c73d95f7888cc7c8f5fc41e4c47ca7bbb412ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / aws_lambda_layer_cli-2.2.0-py3-none-any.whl
| Download URL | aws_lambda_layer_cli-2.2.0-py3-none-any.whl |
|---|---|
| Size | 32.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00de652eecd8dcce08a54861c21587d5640638fc826e901e395481e9141c6015
|
|
BLAKE2b-256 checksum How to use checksums |
4f2a3518ebca18bd1e23d8cdbf785f6719c06118fe3d74bf02e48f47a553dab3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for aws-lambda-layer-cli 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.