Skip to content

Commit 970f97b

Browse files
author
olamide
committed
Fix variable reference
1 parent 9bc991e commit 970f97b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

aws/waf/main.tf

+6-7
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ resource "aws_wafv2_web_acl" "main" {
1414
}
1515

1616
dynamic "rule" {
17-
# for_each = var.header_match_rules == null ? {} : var.header_match_rules
1817
for_each = var.header_match_rules == null ? {} : var.header_match_rules
1918
content {
20-
name = "${header_rule.value["name"]}-header-match-rule"
21-
priority = header_rule.value["priority"]
19+
name = "${rule.value["name"]}-header-match-rule"
20+
priority = rule.value["priority"]
2221

2322
dynamic "action" {
24-
for_each = header_rule.value["count_override"] == true ? [1] : []
23+
for_each = rule.value["count_override"] == true ? [1] : []
2524
content {
2625
count {}
2726
}
2827
}
2928
dynamic "action" {
30-
for_each = header_rule.value["count_override"] == false ? [1] : []
29+
for_each = rule.value["count_override"] == false ? [1] : []
3130
content {
3231
block {}
3332
}
@@ -36,13 +35,13 @@ resource "aws_wafv2_web_acl" "main" {
3635
byte_match_statement {
3736
field_to_match {
3837
single_header {
39-
name = lower(header_rule.value["header_name"])
38+
name = lower(rule.value["header_name"])
4039
}
4140
}
4241

4342
positional_constraint = "CONTAINS"
4443

45-
search_string = header_rule.value["header_value"]
44+
search_string = rule.value["header_value"]
4645

4746
text_transformation {
4847
priority = 1

0 commit comments

Comments
 (0)