From cab52bc9af7a937fb448ec250544fbbb6e66d03c Mon Sep 17 00:00:00 2001 From: badra001 Date: Mon, 25 Oct 2021 11:15:22 -0400 Subject: [PATCH] fix --- common/resources.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/resources.tf b/common/resources.tf index 6f64276..26f5c4d 100644 --- a/common/resources.tf +++ b/common/resources.tf @@ -3,7 +3,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 ? local.self_ports : [] + # self = var.enable_self ? local.self_ports : [] } resource "aws_security_group" "this_security_group" { @@ -39,7 +39,7 @@ resource "aws_security_group" "this_security_group" { # ingress self (list with one or zero items) dynamic "ingress" { - for_each = local.self_port_map + for_each = var.enable_self ? local.self_port_map : {} iterator = sg content { description = "${local.short_description}: self ${sg.value["description"]}"