Skip to content

Commit

Permalink
Fix nested required text_transformation and go back to previous beh…
Browse files Browse the repository at this point in the history
…aviour (#113)

After
#104, a
bug was introduced that would require a nested `text_transformation`. As
it wasn't done across the entire module, it has different behaviours on
different use-cases.

This fixes that bug and reverts to the previous behaviour.
  • Loading branch information
nunofernandes authored Jul 18, 2023
1 parent 6e07c67 commit 9d75cc2
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2122,8 +2122,8 @@ resource "aws_wafv2_web_acl" "main" {
positional_constraint = lookup(byte_match_statement.value, "positional_constraint")
search_string = lookup(byte_match_statement.value, "search_string")
text_transformation {
priority = lookup(byte_match_statement.value["text_transformation"], "priority")
type = lookup(byte_match_statement.value["text_transformation"], "type")
priority = lookup(byte_match_statement.value, "priority")
type = lookup(byte_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -2457,8 +2457,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(sqli_match_statement.value["text_transformation"], "priority")
type = lookup(sqli_match_statement.value["text_transformation"], "type")
priority = lookup(sqli_match_statement.value, "priority")
type = lookup(sqli_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -2518,8 +2518,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(xss_match_statement.value["text_transformation"], "priority")
type = lookup(xss_match_statement.value["text_transformation"], "type")
priority = lookup(xss_match_statement.value, "priority")
type = lookup(xss_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -3894,8 +3894,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(sqli_match_statement.value["text_transformation"], "priority")
type = lookup(sqli_match_statement.value["text_transformation"], "type")
priority = lookup(sqli_match_statement.value, "priority")
type = lookup(sqli_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -3972,8 +3972,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(xss_match_statement.value["text_transformation"], "priority")
type = lookup(xss_match_statement.value["text_transformation"], "type")
priority = lookup(xss_match_statement.value, "priority")
type = lookup(xss_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -4454,8 +4454,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(sqli_match_statement.value["text_transformation"], "priority")
type = lookup(sqli_match_statement.value["text_transformation"], "type")
priority = lookup(sqli_match_statement.value, "priority")
type = lookup(sqli_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -4532,8 +4532,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(xss_match_statement.value["text_transformation"], "priority")
type = lookup(xss_match_statement.value["text_transformation"], "type")
priority = lookup(xss_match_statement.value, "priority")
type = lookup(xss_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -5183,8 +5183,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(sqli_match_statement.value["text_transformation"], "priority")
type = lookup(sqli_match_statement.value["text_transformation"], "type")
priority = lookup(sqli_match_statement.value, "priority")
type = lookup(sqli_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -5261,8 +5261,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(xss_match_statement.value["text_transformation"], "priority")
type = lookup(xss_match_statement.value["text_transformation"], "type")
priority = lookup(xss_match_statement.value, "priority")
type = lookup(xss_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -6133,8 +6133,8 @@ resource "aws_wafv2_web_acl" "main" {
positional_constraint = lookup(byte_match_statement.value, "positional_constraint")
search_string = lookup(byte_match_statement.value, "search_string")
text_transformation {
priority = lookup(byte_match_statement.value["text_transformation"], "priority")
type = lookup(byte_match_statement.value["text_transformation"], "type")
priority = lookup(byte_match_statement.value, "priority")
type = lookup(byte_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -6211,8 +6211,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(sqli_match_statement.value["text_transformation"], "priority")
type = lookup(sqli_match_statement.value["text_transformation"], "type")
priority = lookup(sqli_match_statement.value, "priority")
type = lookup(sqli_match_statement.value, "type")
}
}
}
Expand Down Expand Up @@ -6289,8 +6289,8 @@ resource "aws_wafv2_web_acl" "main" {
}
}
text_transformation {
priority = lookup(xss_match_statement.value["text_transformation"], "priority")
type = lookup(xss_match_statement.value["text_transformation"], "type")
priority = lookup(xss_match_statement.value, "priority")
type = lookup(xss_match_statement.value, "type")
}
}
}
Expand Down

0 comments on commit 9d75cc2

Please sign in to comment.