Enables building AWS Lambda Layers from requirement files as part of CDK deployments
Project description
layer-builder
Simple library that supports building AWS Lambda layers as part of your AWS CDK build process.
Cross-platform (supports both Win and Mac), targeting both x86 and ARM chips, and
based on you existing requirements.txt.
Build from requirements
Using this library, you can
from layer_builder import build_from_requirements
from constructs import Construct
from aws_cdk import Stack, aws_lambda as aws_lambda
class LayerStack(Stack):
def __init__(
self,
scope: Construct,
construct_id: str,
**kwargs,
) -> None:
super().__init__(scope, construct_id, **kwargs)
build_from_requirements(
"../../requirements.txt",
"./build/layer",
max_mb=20, # Check if the size of the layer is larger than expected
clean=True, # Delete previous install
graviton=True, # Specify targeting ARM architecture
)
self.my_layer = aws_lambda.LayerVersion(
self,
"my-layer",
compatible_runtimes=[aws_lambda.Runtime.PYTHON_3_13],
compatible_architectures=[aws_lambda.Architecture.ARM_64],
code=aws_lambda.Code.from_asset("./build/layer"),
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file layer_builder-0.1.0.tar.gz.
File metadata
- Download URL: layer_builder-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.13.5 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b86526f2a3e9432e4c1133591953a0e72fb3e5b96322a4d3ae626ff998895c8
|
|
| MD5 |
b576d3f55356e6331dc3e60b7c988beb
|
|
| BLAKE2b-256 |
dd7dd9023f4042dce9632183ee736d28c7a0bbcec474298ef3e5f12fc0d2a096
|
File details
Details for the file layer_builder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: layer_builder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.13.5 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b99f6578880bba48d9fee69fcbed0c850793da91cec583ec4aa4cf3faed410ab
|
|
| MD5 |
5e3df519ce5da904b20c98444df6adb0
|
|
| BLAKE2b-256 |
9f0c8a7adc3a456a5b5205239c4865015c012bb52aeaf4e6bf582e643d82814d
|