Closed armst297 closed 9 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @armst297 👋 Thank you for taking the time to raise this, and for mentioning that it works fine with Terraform 1.7.1. That confirms for me that this is the same issue that we'd previously seen, the resolution for which was to upgrade to at least Terraform 1.5.3 and AWS Provider 5.8.0. With that in mind, I'll close this issue out.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Core Version
1.2.9, (works on 1.7.1, unsure if able to fully upgrade our current terraform environment to this new version)
AWS Provider Version
5.34.0
Affected Resource(s)
aws_wafv2_web_acl, aws_wafv2_regex_pattern_set
Expected Behavior
Terraform should have applied the following new WAF rule, to use a pattern set to match to a
query_string
or auri_path
.Actual Behavior
After successful plan, when attempting to apply get errors indicating
Provider produced inconsistent final plan
, seems to be erroring on existing rules for AWS Managed WAF Rulesets.This error doesn't occur if all matches in new rule are using
"single_header": { "name": "host" }
, only when attempting to usequery_string
oruri_path
.Relevant Error/Panic Output Snippet
Terraform Configuration Files
Unable to share full configuration details due to data privacy.
Terraform configuration output:
Simplified TF file to plan and apply to recreate issue:
Steps to Reproduce
Have existing cloudfront WAF with AWS Managed Rulesets, add a rule with an
and_statement
ofregex_pattern_set_reference_statement
s, usequery_string
oruri_path
as thefield_to_match
input.May still error without the and component.
Debug Output
Apply Debug Output
Panic Output
No response
Important Factoids
Using custom module with for_each statements to create the configuration in a more standard JSON file.
References
https://github.com/cloudposse/terraform-aws-waf/blob/main/rules.tf https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#regex_pattern_set_reference_statement-block
Would you like to implement a fix?
None