diff --git a/rds-postgres/main.tf b/rds-postgres/main.tf index bfee84d..b1f8443 100644 --- a/rds-postgres/main.tf +++ b/rds-postgres/main.tf @@ -68,7 +68,7 @@ resource "aws_security_group" "this_security_group" { # ingress with prefix lists dynamic "ingress" { - for_each = length(var.ingress_prefix_list_names) > 0 ? local.port_map["external"] : {} + for_each = length(var.ingress_prefix_list_names) > 0 ? local.port_map["external"] : toset([]) iterator = p content { description = "${local.short_description}: ${p.value["description"]}" @@ -132,7 +132,7 @@ resource "aws_security_group" "this_security_group" { # egress with prefix lists dynamic "egress" { - for_each = length(var.egress_prefix_list_names) > 0 ? local.port_map["external"] : {} + for_each = length(var.egress_prefix_list_names) > 0 ? local.port_map["external"] : toset([]) iterator = p content { description = "${local.short_description}: ${local.egress_sg_names[sg]}"