-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop replacing single_header & single_query_argument with an int #19
Conversation
/test all |
@@ -753,15 +753,15 @@ resource "aws_wafv2_web_acl" "default" { | |||
} | |||
|
|||
dynamic "single_header" { | |||
for_each = lookup(field_to_match.value, "single_header", null) != null ? [1] : [] | |||
for_each = lookup(field_to_match.value, "single_header", null) != null ? [field_to_match.value.single_header] : [] | |||
|
|||
content { | |||
name = single_header.value.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be fixed w/o changing the for_each
but instead using
name = field_to_match.value.single_header.value.name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But wouldn't that be very confusing given all the other use of for_each in the file?
E.g.
https://github.com/cloudposse/terraform-aws-waf/blob/master/rules.tf#L499
https://github.com/cloudposse/terraform-aws-waf/blob/master/rules.tf#L463
https://github.com/cloudposse/terraform-aws-waf/blob/master/rules.tf#L248
https://github.com/cloudposse/terraform-aws-waf/blob/master/rules.tf#L145
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this for_each does not follow the pattern that @paulerickson is referring too and the change proposed will make it more consistant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see comment
what
1
, resulting in an error when trying to access itsname
attributewhy
single_header
andsingle_query_argument
are unusable without aname
attributereferences