Skip to content

Commit

Permalink
Fix variable reference
Browse files Browse the repository at this point in the history
  • Loading branch information
olamide committed Apr 3, 2024
1 parent 9bc991e commit 970f97b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions aws/waf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ resource "aws_wafv2_web_acl" "main" {
}

dynamic "rule" {
# for_each = var.header_match_rules == null ? {} : var.header_match_rules
for_each = var.header_match_rules == null ? {} : var.header_match_rules
content {
name = "${header_rule.value["name"]}-header-match-rule"
priority = header_rule.value["priority"]
name = "${rule.value["name"]}-header-match-rule"
priority = rule.value["priority"]

dynamic "action" {
for_each = header_rule.value["count_override"] == true ? [1] : []
for_each = rule.value["count_override"] == true ? [1] : []
content {
count {}
}
}
dynamic "action" {
for_each = header_rule.value["count_override"] == false ? [1] : []
for_each = rule.value["count_override"] == false ? [1] : []
content {
block {}
}
Expand All @@ -36,13 +35,13 @@ resource "aws_wafv2_web_acl" "main" {
byte_match_statement {
field_to_match {
single_header {
name = lower(header_rule.value["header_name"])
name = lower(rule.value["header_name"])
}
}

positional_constraint = "CONTAINS"

search_string = header_rule.value["header_value"]
search_string = rule.value["header_value"]

text_transformation {
priority = 1
Expand Down

0 comments on commit 970f97b

Please sign in to comment.