Skip to content

Commit 62432d3

Browse files
committed
Check CIDR Length
1 parent 68f8891 commit 62432d3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ resource "aws_security_group" "elasticsearch" {
66
}
77

88
resource "aws_security_group_rule" "secure_cidrs" {
9+
count = "${length(var.ingress_allow_cidr_blocks) > 0 ? 1 : 0}"
10+
911
type = "ingress"
1012
from_port = 443
1113
to_port = 443
@@ -28,6 +30,8 @@ resource "aws_security_group_rule" "secure_sgs" {
2830
}
2931

3032
resource "aws_security_group_rule" "nonsecure_cidrs" {
33+
count = "${length(var.ingress_allow_cidr_blocks) > 0 ? 1 : 0}"
34+
3135
type = "ingress"
3236
from_port = 80
3337
to_port = 80

0 commit comments

Comments
 (0)