Skip to content

Commit 8cd4ca1

Browse files
committed
Merge branch 'master' into custom_user_data
2 parents 68d19d3 + 10fad78 commit 8cd4ca1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security_group.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ resource "aws_security_group" "default" {
1111
}
1212

1313
resource "aws_security_group_rule" "egress" {
14+
count = "${var.create_default_security_group == "true" ? 1 : 0}"
1415
type = "egress"
1516
from_port = 0
1617
to_port = 65535
@@ -20,7 +21,7 @@ resource "aws_security_group_rule" "egress" {
2021
}
2122

2223
resource "aws_security_group_rule" "ingress" {
23-
count = "${length(compact(var.allowed_ports))}"
24+
count = "${var.create_default_security_group == "true" ? length(compact(var.allowed_ports)) : 0}"
2425
type = "ingress"
2526
from_port = "${element(var.allowed_ports, count.index)}"
2627
to_port = "${element(var.allowed_ports, count.index)}"

0 commit comments

Comments
 (0)