-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[WAFv2] Resource aws_wafv2_web_acl is recreated on any changes to the rules #13936
Comments
@phplucas Thanks for raising this issue. |
The ACL is also recreated even if you just add new rules to it, without any reordering of priorities or any renaming:
|
The rule name has not been changed at any time. Any other configuration of the changed rule is a reason to recreate the web ACL, for example, the priority, the visibility config. Is this really expected behavior? |
As a complement, I did this same test with the resource aws_waf_web_acl (version 1) and the behavior is different, the web acl is just updated. |
hi @phplucas, thank you for reporting this issue! I was able to reproduce this scenario, where just the |
Here are some examples I have encountered where the entire WAF is destroyed and recreated instead of being modified.
An "easy" fix might be to break out the rules as separate resources rather than having them all inline, that way the destructiuon and recreation could at least be confined to the rule itself instead of the entire WAF. Since these changes are all possible through the console in a non-destructive way, it must be possible through the API as well. |
A fix has been merged and will release with |
This has been released in version 3.2.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
I expected the resource aws_waf2_web_acl to just be updated and not recreated when I changed the priority of a rule for example.
Actual Behavior
When making any changes to the rules, the resource aws_wafv2_web_acl is recreated.
Steps to Reproduce
Just change the rule priority
The text was updated successfully, but these errors were encountered: