
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
A utility to bundle python code and/or dependencies for deployment to AWS Lambda
Lambda Bundler helps you package your python lambda functions and their dependencies for deployment to AWS.
It supports three different modes:
Dependencies will be cached if possible in order to provide a fast build experience.
The installation is very simple using pip:
pip install lambda-bundler
from lambda_bundler import build_layer_package
path_to_deployment_artifact = build_layer_package(
# You can install the dependencies from multiple
# requirement files into a single layer
requirement_files=[
"path/to/requirements.txt"
]
)
# path_to_deployment_artifact now points to a zip archive with the dependencies.
from lambda_bundler import build_lambda_package
path_to_deployment_artifact = build_lambda_package(
code_directories=[
"path/to/package",
"path/to/other/package
],
exclude_patterns=[
"*.pyc"
]
)
# path_to_deployment_artifact now contains the path to the zip archive
If you'd like to package your dependencies directly into the deployment artifact you can do that very easily. Please keep in mind, that the size limit for a zipped deployment package is 50MB according to the documentation and the content of packages larger than 3MB won't be visible in the code editor in the console.
from lambda_bundler import build_lambda_package
path_to_deployment_artifact = build_lambda_package(
code_directories=[
"path/to/package",
"path/to/other/package
],
requirement_files=[
"path/to/requirements.txt
],
exclude_patterns=[
"*.pyc"
]
)
# path_to_deployment_artifact now contains the path to the zip archive
The library uses a working directory to build and cache packages.
By default this is located in the lambda_bundler_builds
folder in your temporary directory as determined by python.
If you'd like to change that, you can set the LAMBDA_BUNDLER_BUILD_DIR
environment variable and point it to another directory.
If you're using the Cloud Development Kit and just want to do a cdk synth
to check your infrastructure code without actually deploying it, you can set the environment variable LAMBDA_BUNDLER_SKIP_INSTALL
to true
. This will skip installing dependencies and bundling the code, which makes the process a lot faster - although it won't work when you try to deploy it with the variable set to true
.
For an example of how to use this, I suggest you check out the demo repository which includes a CDK app that deploys three lambda functions with dependencies of different sizes. If you take a closer look at the build pipeline you'll see, how effective the caching is.
FAQs
A utility to bundle python code and/or dependencies for deployment to AWS Lambda
We found that lambda-bundler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.