Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 10, 2021
1 parent 5c71d8e commit 58f1a22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nacl-rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ locals {
action = local.rule_definitions[p[1]][4]
rule_number = local.rule_number }
]
r2_in = { for nr in local.r2 : nr.label => nr if ! nr.egress }
r2_out = { for nr in local.r2 : nr.label => nr if nr.egress }
r2_in = [for nr in local.r2 : nr if ! nr.egress]
r2_out = [for nr in local.r2 : nr if nr.egress]
r3_in = [for i in range(length(local.r2_in)) :
merge(
local.r2_in[i],
Expand All @@ -110,7 +110,7 @@ locals {
}

resource "aws_network_acl_rule" "in" {
for_each = local.r3_in
for_each = { for r in local.r3_in : r.label => r }
network_acl_id = var.network_acl_id
rule_number = each.value.rule_number
egress = each.value.egress
Expand All @@ -122,7 +122,7 @@ resource "aws_network_acl_rule" "in" {
}

resource "aws_network_acl_rule" "out" {
for_each = local.r3_out
for_each = { for r in local.r3_out : r.label => r }
network_acl_id = var.network_acl_id
rule_number = each.value.rule_number
egress = each.value.egress
Expand Down

0 comments on commit 58f1a22

Please sign in to comment.