Skip to content

Commit f59b33e

Browse files
committed
fix: make sure we use null check
1 parent b5fcd02 commit f59b33e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/ami-updater/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ resource "aws_iam_role_policy" "ami_updater_logging" {
122122
}
123123

124124
resource "aws_iam_role_policy_attachment" "ami_updater_vpc_execution_role" {
125-
count = length(var.lambda_subnet_ids) > 0 ? 1 : 0
125+
count = var.lambda_subnet_ids != null && var.lambda_security_group_ids != null ? 1 : 0
126126
role = aws_iam_role.ami_updater.name
127127
policy_arn = "arn:${var.aws_partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
128128
}

0 commit comments

Comments
 (0)