Skip to content
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

Support for respecting filter order in aws_wafv2_web_acl_logging_configuration #35499

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gdemarcsek
Copy link
Contributor

@gdemarcsek gdemarcsek commented Jan 26, 2024

Description

Adds an optional priority attribute to WAFv2 ACL logging configuration filters that can control the order in which the filters are supplied to the AWS API. This way it provides a non-breaking way to overcome the issue that the API actually represents the filters as an ordered list (array) and the order does affect the behaviour. At the same time, the current schema represents filters as a set.

Unfortunately, this is somewhat under-documented on AWS's side as well, but it is made clear on the console where it mentions:

If you add multiple filters, AWS WAF evaluates them starting from the top.

See also the linked issue.

Relations

Closes #32665

References

Output from Acceptance Testing

% make testacc TESTS=TestAccWAFV2WebACLLoggingConfiguration_loggingFilter PKG=wafv2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/wafv2/... -v -count 1 -parallel 20 -run='TestAccWAFV2WebACLLoggingConfiguration_loggingFilter'  -timeout 360m
=== RUN   TestAccWAFV2WebACLLoggingConfiguration_loggingFilter
=== PAUSE TestAccWAFV2WebACLLoggingConfiguration_loggingFilter
=== CONT  TestAccWAFV2WebACLLoggingConfiguration_loggingFilter


--- PASS: TestAccWAFV2WebACLLoggingConfiguration_loggingFilter (192.88s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/wafv2      200.140s
...

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/wafv2 Issues and PRs that pertain to the wafv2 service. and removed size/M Managed by automation to categorize the size of a PR. labels Jan 26, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 26, 2024
@github-actions github-actions bot added the size/M Managed by automation to categorize the size of a PR. label Jan 26, 2024
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 26, 2024
even though the order can change once the set elements change, for unchanged sets, the order
is deterministic according to https://github.com/hashicorp/terraform-plugin-sdk/blob/19a0da04f4b59dd187a8472b63d4262b892dd244/helper/schema/set.go#L100 so let's make sure this sort is not regressing that for plans that do not change the filters but also do not specify an explicit priority
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/wafv2 Issues and PRs that pertain to the wafv2 service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_wafv2_web_acl_logging_configuration filter ordering is undefined
2 participants