Skip to content

Commit

Permalink
made vpc config dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed Aug 15, 2024
1 parent 5fefb44 commit adfba38
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ resource "aws_lambda_function" "lambda_function" {
tags = var.tags
architectures = var.architectures

vpc_config {
subnet_ids = var.subnet_ids
security_group_ids = local.security_group_ids
dynamic vpc_config {
for_each = local.security_group_ids != [] ? [1] : []
content {
subnet_ids = var.subnet_ids
security_group_ids = local.security_group_ids
}
}

environment {
variables = var.lambda_env
}
Expand Down

0 comments on commit adfba38

Please sign in to comment.