File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ locals {
2323 enable_cidr_rules = var. enable_security_group && (length (var. allowed_ip ) > 0 )
2424 enable_source_sec_group_rules = var. enable_security_group && (length (var. security_groups ) > 0 )
2525 ports_source_sec_group_product = setproduct (compact (var. allowed_ports ), compact (var. security_groups ))
26+ enable_cidr_rules_ipv6 = var. enable_security_group && (length (var. allowed_ipv6 ) > 0 )
2627}
2728
2829# Module : SECURITY GROUP
@@ -55,7 +56,7 @@ resource "aws_security_group_rule" "egress" {
5556 prefix_list_ids = var. prefix_list
5657}
5758resource "aws_security_group_rule" "egress_ipv6" {
58- count = var. enable_security_group == true ? 1 : 0
59+ count = var. enable_security_group == true && local . enable_cidr_rules_ipv6 == true ? length ( compact (var . allowed_ports )) : 0
5960
6061 type = " egress"
6162 from_port = 0
@@ -80,7 +81,7 @@ resource "aws_security_group_rule" "ingress" {
8081 security_group_id = join (" " , aws_security_group. default . * . id )
8182}
8283resource "aws_security_group_rule" "ingress_ipv6" {
83- count = var. enable_security_group == true && local. enable_cidr_rules == true ? length (compact (var. allowed_ports )) : 0
84+ count = var. enable_security_group == true && local. enable_cidr_rules_ipv6 == true ? length (compact (var. allowed_ports )) : 0
8485
8586 type = " ingress"
8687 from_port = element (var. allowed_ports , count. index )
You can’t perform that action at this time.
0 commit comments