Skip to content

Commit

Permalink
fix: database nacl count using local.create_intranet
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanoolala committed Mar 25, 2024
1 parent f47803c commit 1b6326a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nacl.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ resource "aws_network_acl_rule" "database_outbound_allow_all_ephemeral_rule" {
}

resource "aws_network_acl_rule" "database_inbound_allow_all_ephemeral_rule_secondary_cidr" {
count = local.create_intranet ? length(var.secondary_cidr_blocks) : 0
count = local.create_database ? length(var.secondary_cidr_blocks) : 0
network_acl_id = aws_network_acl.database[0].id
rule_number = 1010 + count.index
cidr_block = var.secondary_cidr_blocks[count.index]
Expand All @@ -1114,7 +1114,7 @@ resource "aws_network_acl_rule" "database_inbound_allow_all_ephemeral_rule_secon
}

resource "aws_network_acl_rule" "database_outbound_allow_all_ephemeral_rule_secondary_cidr" {
count = local.create_intranet ? length(var.secondary_cidr_blocks) : 0
count = local.create_database ? length(var.secondary_cidr_blocks) : 0
network_acl_id = aws_network_acl.database[0].id
rule_number = 1010 + count.index
cidr_block = var.secondary_cidr_blocks[count.index]
Expand All @@ -1123,4 +1123,4 @@ resource "aws_network_acl_rule" "database_outbound_allow_all_ephemeral_rule_seco
to_port = 65535
rule_action = "allow"
egress = true
}
}

0 comments on commit 1b6326a

Please sign in to comment.