aws:howtouselambdalayer
Differences
This shows you the differences between two versions of the page.
| aws:howtouselambdalayer [09/03/2023 13:00] – created - external edit 127.0.0.1 | aws:howtouselambdalayer [30/05/2025 15:05] (current) – removed andrew | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== How to use a Lambda Layer ====== | ||
| - | |||
| - | |||
| - | Terraform to deploy a lambda function with a layer, this deploys Boto3 as a layer, a bit strange but I needed the functionality to create an " | ||
| - | |||
| - | lambda.tf | ||
| - | < | ||
| - | data " | ||
| - | type = " | ||
| - | source_file = " | ||
| - | output_path = " | ||
| - | } | ||
| - | |||
| - | resource " | ||
| - | filename | ||
| - | function_name | ||
| - | role = aws_iam_role.role_for_lambda.arn | ||
| - | handler | ||
| - | source_code_hash = data.archive_file.lambda-archive.output_base64sha256 | ||
| - | runtime | ||
| - | timeout | ||
| - | memory_size | ||
| - | layers | ||
| - | } | ||
| - | |||
| - | resource " | ||
| - | filename | ||
| - | layer_name | ||
| - | source_code_hash | ||
| - | compatible_runtimes = [" | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | |||
| - | iam.tf | ||
| - | < | ||
| - | resource " | ||
| - | name = " | ||
| - | path = "/" | ||
| - | permissions_boundary = " | ||
| - | assume_role_policy = " | ||
| - | tags = { | ||
| - | tag-key = " | ||
| - | } | ||
| - | } | ||
| - | |||
| - | resource " | ||
| - | role = aws_iam_role.role_for_lambda.name | ||
| - | policy_arn = " | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | assumerolepolicy.json | ||
| - | <code json> | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | ] | ||
| - | } | ||
| - | </ | ||
| - | |||
aws/howtouselambdalayer.1678366824.txt.gz · Last modified: by 127.0.0.1
