Skip to content

Commit 492e71f

Browse files
committed
added ability to pass in security groups for lambda
1 parent 5dbc94a commit 492e71f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ resource aws_lambda_function "lambda" {
216216
runtime = var.runtime
217217
timeout = var.timeout
218218
vpc_config {
219-
security_group_ids = [
220-
aws_security_group.vpc_sec.id]
219+
security_group_ids = concat([
220+
aws_security_group.vpc_sec.id,
221+
], var.lambda-security-group-ids)
221222
subnet_ids = module.acs.private_subnet_ids
222223
}
223224
environment {

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,8 @@ variable "root-resource-authorization" {
8787
variable "swagger-path" {
8888
type = string
8989
}
90+
91+
variable "lambda-security-group-ids" {
92+
type = list(string)
93+
default = []
94+
}

0 commit comments

Comments
 (0)