-
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
Significant slowdowns running terraform for WAF resources on AWS provider v2.69.0 #14062
Comments
We are hitting the exact same problem. When the WAFv2 module is enabled our plan/apply time increases exponentially. |
I just noticed this yesterday. The following example takes about 11 seconds to run provider "aws" {
region = "us-east-1"
version = "~> 2.69.0"
}
resource "aws_wafv2_web_acl" "acl" {
name = "test_acl"
description = "test_acl"
scope = "REGIONAL"
default_action {
allow {}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "test_acl"
sampled_requests_enabled = true
}
} |
it affects 2.70.0 as well, the issue is exacerbated if there are rules and other blocks. |
Hi all 👋 . From initial review of this issue, I see it unfortunately stems from #13961 which addressed #13862 and was introduced in |
Thank you for your quick response, I ask you to reconsider releasing the fix you made on #14073 before the major release |
@anGie44 with v3.0.0 being released, do you have a target version and/or timeline for this being addressed? |
I wonder how could you release this change with its current status, it speaks loudly on quality controls of the project. basically it ruins the whole experience. and it seems no one feels the need to release this quicker. |
To level things out I just want to say a big thank you to the all the awesome terraform aws provider contributors who donate their free time to make this project possible! |
I reiterate this sentiment too. |
Provider 2.70.0 |
Hi all 👋 -- first off, apologies for the silence here! This has been prioritized and we are investigating with the Terraform Core team to further debug the behavior imposed by this rather large schema in the WebACL resource. I will update here accordingly with a more detailed response as to what our next steps will be once we can narrow down where the time is being spent during the Please note, from the provider perspective, there isn't more we can do at the moment to lessen the burden of the slowness everyone is experiencing without directly reducing the number of supported statements i.e. a breaking change to revert the changes to support #13862 to see the runtimes previously seen in |
Following up here: this new issue in terraform tracks the behavior we're seeing with the nested statements and the significant slowdowns hashicorp/terraform#25889 Again, unfortunately there's not much we can do within the provider code except for making the schema less nested in the webACL resource atm. The hope would be to have upstream terraform optimizations take place in order to keep the schema depth as-is. |
@anGie44 , it seems that there is no quick fix for the specified upstream issue at this moment. It's probably also not feasible to expect WAFv2 API to change (or WAFv3 to be released) any time soon which will allow to specify a string (JSON, YAML) instead of structured data. |
It would be great if everybody who upvoted this specific issue could also upvote the corresponding upstream issue (mentioned above by anGie44). The ratio is 5:1 atm :(. |
Voted. The performance difference is quite huge with a modest set of rules. I just coverted to WAFv2 and was surprised. |
A few local (from home) performance tests timings (IP sets as an example from the same service but without a huge schema) with default parallelism settings:
I don't want to test managing the default limit of 100 WAFv2 ACLs using Terraform. It probably will take more than an hour. |
A quick and dirty workaround for me was to use 2.67.0 provider version for WAFv2 Web ACL resource. Everything is fine and validate-plan-apply steps are quick as usual. Hope this helps! |
I've noticed a bug with versions prior to 3.0 when 'create before destroy' lifecycle attribute is used, which leads to an error during Terraform apply about duplicate statements or something like that. There was no notice that the bug was fixed, but when I've upgraded provider to v3.2 everything is fine. So if you're going to use the above workaround - test your scenarios. |
I just moved 3 resources to a new module to see if WAFv2 was causing the slowness aws_wafv2_ip_set.devs[0]
aws_wafv2_web_acl.main_alb
aws_wafv2_web_acl.main_cdn This module is now very very slow, compared to before adding the resources, about 10x slower.
|
I tried including wafv2 resources in one of my modules but disabled with |
Also see #5822 |
Hi , the issue is still occurring with aws provider 3.0, is it going to be fixed soon? |
encountering the same issue with 3.10.0 version as well |
Good news @samtarplee and those following this issue, the upstream terraform issue hashicorp/terraform#25889 has a PR to fix the slowdowns experienced here 🎉 I'll provide an update here again when it lands in the forthcoming release of Terraform |
encountering the same issue with 3.11.0 version as well |
Terraform |
Confirming this issue has been resolved when using Given the example in the description (Regional WebACL w/3 rules: 2 ManagedRuleGroups, 1 Rate-based) in With
|
Can confirm as well. Upgrading to 13.5, plan/apply times in our CI/CD process dropped considerably, 75% in some cases. |
Thank you all for this wonderful optimization, in our case we went from about 245s to about 11s (for a lot of resources, not only a WAFv2, so a normal time indeed)... That's a tremendous improvement ! Kudos to everyone who made it possible. |
Closing this on account that the behavior is resolved with the upstream terraform upgrade (v0.13.5) - thank you all for your patience 👍 if facing any further issues related to |
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
0.12.28
Affected Resource(s)
Terraform Configuration Files
Debug Output
Expected Behavior
This should create a plan within a few seconds after running
terraform plan
, and validate the code after aterraform validate
It should also only take up to a couple of minutes to run a
terraform plan
Actual Behavior
The plan and validate take a very long time to run - it works eventually, but it's taking upwards of 3 minutes for the validate, and five minutes, normally around ten for the plan. This is just for the one resource.
Apply takes even longer than this, presumably because it's running a plan on-top of doing other things.
If I downgrade my provider version to v 2.67.0, all of the actions are completed within a few seconds, as expected.
Steps to Reproduce
terraform plan
terraform plan
Important Factoids
This only seems to affect WAF resources, I've tried the provider in other projects and haven't seen any issues.
I'm unsure if it's limited to the web acl resource specifically, but that's the only one I've been able to reproduce it in
References
N/A
The text was updated successfully, but these errors were encountered: