File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,13 @@ resource "aws_lambda_function" "api_lambda" {
250
250
runtime = var. runtime
251
251
publish = true
252
252
253
+ dynamic "environment" {
254
+ for_each = var. environment_variables != null ? [1 ] : []
255
+ content {
256
+ variables = var. environment_variables
257
+ }
258
+ }
259
+
253
260
vpc_config {
254
261
subnet_ids = var. private_subnet_ids
255
262
security_group_ids = concat ([aws_security_group . lambda_sg . id ], var. security_groups )
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ variable "runtime" {
28
28
description = " Lambda runtime"
29
29
}
30
30
31
+ variable "environment_variables" {
32
+ type = map (string )
33
+ description = " A map that defines environment variables for the Lambda function."
34
+ default = null
35
+ }
36
+
31
37
variable "hosted_zone" {
32
38
type = object ({
33
39
name = string ,
You can’t perform that action at this time.
0 commit comments