File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ No requirements.
1919
2020| Name | Description | Type | Default | Required |
2121| ------| -------------| ------| ---------| :--------:|
22+ | environment | Environment variables to configure the Lambda function | ` map(string) ` | ` {} ` | no |
2223| function\_ name | Name of the Lambda function | ` any ` | n/a | yes |
2324| role | IAM role assumed by the Lambda function | ` any ` | n/a | yes |
2425| runtime | A runtime to use for the function (leave blank to use default runtime) | ` any ` | ` null ` | no |
Original file line number Diff line number Diff line change @@ -22,4 +22,10 @@ resource "aws_lambda_function" "function" {
2222 handler = " ${ var . function_name } .${ local . templates [var . template ][" lambda_handler" ]} "
2323 runtime = var. runtime != null ? var. runtime : local. templates [var . template ][" default_runtime" ]
2424 source_code_hash = data. archive_file . function . output_base64sha256
25+ dynamic "environment" {
26+ for_each = length (var. environment ) > 0 ? [1 ] : []
27+ content {
28+ variables = var. environment
29+ }
30+ }
2531}
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ variable "runtime" {
1111 default = null
1212}
1313
14+ variable "environment" {
15+ description = " Environment variables to configure the Lambda function"
16+ type = map (string )
17+ default = {}
18+ }
19+
1420variable "role" {
1521 description = " IAM role assumed by the Lambda function"
1622}
You can’t perform that action at this time.
0 commit comments