resource/wafv2_web_acl: fix rule expansion at update time and refactor shared schemas #14073
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community Note
Closes #14035
Closes #14029
Closes #14326
Affected by #14062
Notes
expandWafv2Rules()
originally called atUpdate
was missing references to statement types (unlike theexpandWafv2WebACLRules()
used atCreate
) including managed_rule_group, rate_based, etc. resulting in empty Statement fields in UpdateWebACL requests (as seen in debug logs in the referenced issues above). As AWS documents the Rule object as shared by both the WebACL and Rule Group resources, expansion/flatten methods affecting rules and their statements have been refactored in an effort to conform to only 1 representation of a WAFv2 Rule across resources; majority of these methods inwafv2_web_acl
migrated towafv2_helper
with naming conventions generalized to account for rule group and web acl resources.rule_group
resource as it shares the WAFv2 rule representation with an additional statement level for and/or/not and rate_based_statements sincev2.69.0
of the providerRelease note for CHANGELOG:
Output from acceptance testing: