diff --git a/rds-postgres/main.tf b/rds-postgres/main.tf index fc8d2f7..1e8a814 100644 --- a/rds-postgres/main.tf +++ b/rds-postgres/main.tf @@ -59,7 +59,7 @@ locals { external_ingress_networks = compact(concat(local.vpc_networks, local.ingress_networks)) ## ingress_sg_names = zipmap(var.ingress_security_groups, data.aws_security_group.ingress_security_groups[*].name) ## egress_sg_names = zipmap(var.egress_security_groups, data.aws_security_group.egress_security_groups[*].name) - self = var.enable_self ? [1] : [] + ## self = var.enable_self ? [1] : [] short_description = var.short_description == "" ? var.description : var.short_description } @@ -112,7 +112,7 @@ resource "aws_security_group" "this_security_group" { # ingress self (list with one or zero items) dynamic "ingress" { - for_each = local.self ? local.port_map["external"] : toset([]) + for_each = var.enable_self ? local.port_map["external"] : toset([]) iterator = sg content { description = "${local.short_description}: ${p.value["description"]}"