diff --git a/custom/custom.tf b/custom/custom.tf index 1eed1d4..c1c2d7e 100644 --- a/custom/custom.tf +++ b/custom/custom.tf @@ -123,7 +123,7 @@ resource "aws_security_group" "this_security_group" { # inress with prefix lists dynamic "ingress" { - for_each = length(var.ingress_prefix_list_names) && length(var.ingress_prefix_list_ports) > 0 ? toset(var.ingress_prefix_list_ports) : toset([]) + for_each = length(var.ingress_prefix_list_names) > 0 && length(var.ingress_prefix_list_ports) > 0 ? toset(var.ingress_prefix_list_ports) : toset([]) iterator = p content { description = try(p.value.label, local.short_description) @@ -162,7 +162,7 @@ resource "aws_security_group" "this_security_group" { # egress with prefix lists dynamic "egress" { - for_each = length(var.egress_prefix_list_names) && length(var.egress_prefix_list_ports) > 0 ? toset(var.egress_prefix_list_ports) : toset([]) + for_each = length(var.egress_prefix_list_names) > 0 && length(var.egress_prefix_list_ports) > 0 ? toset(var.egress_prefix_list_ports) : toset([]) iterator = p content { description = try(p.value.label, local.short_description)