You have to specify lambda layers as ARNs in terraform using layers parameter:
layers - (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function.
Using the following syntax in terraform:
layers = ["layer-arn"]
For example, the ARN for AWSLambda-Python27-SciPy1x in us-east-1 region is:
arn:aws:lambda:us-east-1:668099181075:layer:AWSLambda-Python27-SciPy1x:24
If you not sure what is your ARN, you can create a dummy a Python 2.7 lambda function, add AWS layer AWSLambda-Python27-SciPy1x layer, and the console will give you its ARN.
Terraform Registry
registry.terraform.io › providers › hashicorp › aws › latest › docs › resources › lambda_layer_version
aws_lambda_layer_version | Resources | hashicorp/aws | Terraform | Terraform Registry
Registry · Please enable Javascript to use this application · Browse aws documentation · Report an issue
Videos
09:14
Terraform to Create AWS Lambda Layer Using | GitHub Actions - YouTube
10:21
Speeding up the AWS Lambda layer building - YouTube
17:39
Terraform Deploy Lambda Function | Terraform IAM Role | AWS Terraform ...
29:44
IaC on AWS with Terraform: Provision a Lambda Function with Layers ...
15:58
How to setup and use AWS Lambda Layer - YouTube
HashiCorp Discuss
discuss.hashicorp.com › terraform
How to import an external lambda layer into terraform? - Terraform - HashiCorp Discuss
November 14, 2019 - I’m trying to use datadog lambda layer in my lambda function to send datadog metrics: I can set this up manually from console. However, I’m not sure how to get it working in terraform. So far I have the following resource: resource "aws_lambda_layer_version" "datadog_layer" { layer_name = "${local.datadog_layer_name}" compatible_runtimes = ["python2.7"] } And I tried to import it with: terraform import ...
Terraform
registry.terraform.io › modules › terraform-aws-modules › lambda › aws › latest › examples › complete
terraform-aws-modules/lambda/aws | complete Example | Terraform Registry
Configuration in this directory creates AWS Lambda Function, Layers, Alias, and so on with the large variety of supported features showing this module in action.
Terraform Registry
registry.terraform.io › providers › hashicorp › aws › latest › docs › data-sources › lambda_layer_version
aws_lambda_layer_version - Terraform Registry
Registry · Please enable Javascript to use this application
HashiCorp Discuss
discuss.hashicorp.com › terraform
Terraform to create lambda layer by specify arn - Terraform - HashiCorp Discuss
January 7, 2021 - I’m trying to use libre office lambda layer in my lambda function : I can set this up manually from console. However, I’m not sure how to get it working in terraform. So far I have the following resource: data “archive_file” “converttopdf_lambda” { type = “zip” source_dir = “./data/converttopdf” output_path = “converttopdf.zip” } resource “aws_lambda_layer_version” “lambda_converttopdf_lambda” { layer_name = var.converttopdf_layername filename = “${data.archive_file....
GitHub
github.com › enter-at › terraform-aws-lambda-layer
GitHub - enter-at/terraform-aws-lambda-layer: Terraform module designed to facilitate the creation of AWS Lambda layers
module "layer" { source = "git::https://github.com/enter-at/terraform-aws-lambda-layer.git?ref=main" layer_name = "dependencies" source_dir = "../src/lib" source_type = "python" rsync_pattern = [ "--exclude='**tests**'", "--exclude='**__pycache__**'", "--include=module/{a,b,c}/", "--include='*.py'", "--exclude='module/*'" ] } ... (Optional) The location of the package manager config file. Can be one of (package.json, requirements.txt, Pipfile) ... The Amazon Resource Name (ARN) of the Lambda layer with version.
Starred by 13 users
Forked by 14 users
Languages HCL 56.0% | Shell 35.2% | Makefile 8.8% | HCL 56.0% | Shell 35.2% | Makefile 8.8%
Terraform Registry
registry.terraform.io › providers › hashicorp › aws › 3.4.0 › docs › resources › lambda_layer_version
aws_lambda_layer_version | Resources | hashicorp/aws
Registry · Please enable Javascript to use this application
Terraform Registry
registry.terraform.io › modules › corpit-consulting-public › lambda-layer-version-mod › aws › latest
corpit-consulting-public/lambda-layer-version-mod/aws
July 20, 2020 - Registry · Please enable Javascript to use this application
Terraform Registry
registry.terraform.io › modules › hendrixroa › lambda-layer › aws › latest
hendrixroa/lambda-layer/aws
March 23, 2023 - Registry · Please enable Javascript to use this application
Medium
medium.com › wescale › how-to-lightweight-your-python-aws-lambda-functions-with-aws-lambda-layer-docker-and-terraform-b48602e76e8b
How to lightweight your Python AWS Lambda functions with AWS Lambda Layer, Docker, and Terraform. | by Tanguy Combe | WeScale | Medium
April 11, 2022 - Fortunately, AWS developed a new feature named AWS Lambda Layer to let you build common packages usable by the runtime. We will dive into this use case: how can I package with ease a big Python library and use it through AWS console within one or multiple Lambda functions? Suppose that you have some data engineering stuff to do, you may need to use Pandas to workaround your application. ... Terraform ~> 0.11.12 to use filebase64hash256 for Terraform to detect code changes, it can also work with base64sha256(file()) for Terraform earlier versions.