Skip to content

Commit c1208b2

Browse files
author
olamide
committed
Remove geo location scope down statement for header match block since it's not supported
1 parent 2c83c26 commit c1208b2

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

aws/waf/main.tf

+2-23
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ resource "aws_wafv2_web_acl" "main" {
1414
}
1515

1616
dynamic "rule" {
17-
for_each = var.header_match_rules
17+
# for_each = var.header_match_rules == null ? {} : var.header_match_rules
18+
for_each = var.header_match_rules == null ? {} : var.header_match_rules
1819
content {
1920
name = "${rule.value["name"]}-header-match-rule"
2021
priority = rule.value["priority"]
@@ -47,28 +48,6 @@ resource "aws_wafv2_web_acl" "main" {
4748
priority = 1
4849
type = "LOWERCASE"
4950
}
50-
51-
dynamic "scope_down_statement" {
52-
for_each = length(concat(rule.value["country_list"], rule.value["exempt_country_list"])) > 0 ? [1] : []
53-
content {
54-
dynamic "geo_match_statement" {
55-
for_each = length(rule.value["country_list"]) > 0 ? [1] : []
56-
content {
57-
country_codes = rule.value["country_list"]
58-
}
59-
}
60-
dynamic "not_statement" {
61-
for_each = length(rule.value["exempt_country_list"]) > 0 ? [1] : []
62-
content {
63-
statement {
64-
geo_match_statement {
65-
country_codes = rule.value["exempt_country_list"]
66-
}
67-
}
68-
}
69-
}
70-
}
71-
}
7251
}
7352
}
7453
visibility_config {

0 commit comments

Comments
 (0)