Terraform module that builds AWS Lambda layers from a list of Python dependencies. Packages are installed inside Docker for platform-consistent builds, so layers work on Lambda regardless of the machine running Terraform.
Available on the Terraform Registry.
module "python_layer" {
source = "MarioMoura/pythonll/aws"
layer_name = "my_python_layer"
layer_name_prefix = var.environment
requirements = [
"requests==2.32.3",
"numpy==2.1.0",
]
}| Name | Description | Type | Default |
|---|---|---|---|
requirements |
Python requirements (pip format) | list(string) |
required |
layer_name |
Name of the layer | string |
required |
layer_name_prefix |
Prefix for the layer name, generally the environment | string |
null |
python_version |
Python version to build against | string |
"3.13" |
Docker must be available on the machine running Terraform.