Skip to content

Commit f96eda1

Browse files
authored
Merge pull request #27 from byu-oit/add-layers
Expose "layers" lambda variable
2 parents 07069ab + e3b8936 commit f96eda1

File tree

8 files changed

+22
-12
lines changed

8 files changed

+22
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ Also Note: CodePipeline and CodeDeploy cannot be used together to deploy a Lambd
2727
For a Zip file lambda
2828
```hcl
2929
module "lambda_api" {
30-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.0.1"
30+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.1.0"
3131
app_name = "my-lambda-codedeploy-dev"
32-
env = "dev"
3332
zip_filename = "./src/lambda.zip"
3433
zip_handler = "index.handler"
3534
zip_runtime = "nodejs12.x"
@@ -51,7 +50,7 @@ module "lambda_api" {
5150
For a docker image lambda:
5251
```hcl
5352
module "lambda_api" {
54-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.0.1"
53+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.1.0"
5554
app_name = "my-docker-lambda"
5655
image_uri = "my-image-from-my-ecr:latest"
5756
hosted_zone = module.acs.route53_zone
@@ -111,7 +110,8 @@ module "lambda_api" {
111110
| tags | map(string) | A map of AWS Tags to attach to each resource created | {} |
112111
| role_permissions_boundary_arn | string | IAM Role Permissions Boundary ARN | |
113112
| log_retention_in_days | number | CloudWatch log group retention in days. Defaults to 7. | 7 |
114-
| lambda_policies | list(string) | List of IAM Policy ARNs to attach to the lambda role. | []' |
113+
| lambda_policies | list(string) | List of IAM Policy ARNs to attach to the lambda role. | [] |
114+
| lambda_layers | list(string) | List of Lambda Layer Version ARNs (maximum of 5) to attach to your function. | [] |
115115
| timeout | number | How long the lambda will run (in seconds) before timing out | 3 (same as terraform default) |
116116
| memory_size | number | Size of the memory of the lambda. CPU will scale along with it | 128 (same as terraform default) |
117117
| xray_enabled | bool | Whether or not the X-Ray daemon should be created with the Lambda API. | false |

changelog.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## v2.1.0
4+
4/22/2022 - `lambda_layers` variable added as pass-through to `layers` variable of `aws_lambda_function` resource
5+
6+
## v2.0.1
7+
3/11/2022 - increased `app_name` variable length
8+
- increased `app_name` variable length from 24 to 28
9+
310
## v2.0.0
411
2/24/2022 - Major breaking changes from v1.x:
512
- dropped support for terraform v0.12
@@ -10,7 +17,3 @@
1017
- removed `use_codedeploy` variable - just include the codedeploy variables to enable codedeploy
1118
- removed `env` variable - just include the env inside the `app_name` variable
1219
- added `domain_url` variable to enable a custom API URL
13-
14-
## v2.0.1
15-
3/11/2022 - increased `app_name` variable length
16-
- increased `app_name` variable length from 24 to 28

examples/docker-lambda/docker.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.0.1"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.1.0"
1313
app_name = "my-docker-lambda"
1414
image_uri = "my-image-from-my-ecr:latest"
1515
hosted_zone = module.acs.route53_zone

examples/no-codedeploy/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.0.1"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.1.0"
1313
app_name = "my-lambda-dev"
1414
zip_filename = "./src/lambda.zip"
1515
zip_handler = "index.handler"

examples/simple-lambda-in-vpc/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.0.1"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.1.0"
1313
app_name = "my-lambda-dev"
1414
zip_filename = "./src/lambda.zip"
1515
zip_handler = "index.handler"

examples/simple-lambda-with-deploy-test/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.0.1"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v2.1.0"
1313
app_name = "my-lambda-codedeploy-dev"
1414
env = "dev"
1515
zip_filename = "./src/lambda.zip"

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ resource "aws_lambda_function" "zip_api" {
251251
handler = var.zip_handler
252252
runtime = var.zip_runtime
253253
publish = true
254+
layers = var.lambda_layers
254255
timeout = var.timeout
255256
memory_size = var.memory_size
256257

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ variable "lambda_policies" {
124124
default = []
125125
}
126126

127+
variable "lambda_layers" {
128+
type = list(string)
129+
description = "List of Lambda Layer Version ARNs (maximum of 5) to attach to your function."
130+
default = []
131+
}
132+
127133
variable "timeout" {
128134
type = number
129135
description = "Timeout (in seconds) for lambda. Defaults to 3 (terraform default"

0 commit comments

Comments
 (0)