Skip to content

Commit

Permalink
updating the key to allow ingress and egress to share rule numbers wh…
Browse files Browse the repository at this point in the history
…ich is inline with aws spec
  • Loading branch information
petercort committed Jul 6, 2023
1 parent 0f670b2 commit 1af4ff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resource "aws_network_acl" "main" {
}

resource "aws_network_acl_rule" "rule" {
for_each = { for index, rule in var.rules : rule.rule_number => rule }
for_each = { for index, rule in var.rules : format("%s/%s",rule.rule_number,rule.rule_type) => rule }
network_acl_id = aws_network_acl.main.id
rule_number = each.value.rule_number
egress = each.value.rule_type == "egress" ? true : false
Expand Down

0 comments on commit 1af4ff6

Please sign in to comment.