-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
terraform takes 5 minutes to create a aws_security_group_rule. #6938
Comments
hey @sk-cool is this reproducible? Can you run this with |
Hi @catsby, Thanks for your reply. Yes, this is reproducible. Please find attached logs. Please see below command line output. aws_security_group_rule.egress40: Still creating... (4m10s elapsed) Meanwhile, I tried the following which worked good.
This happened pretty fast. However If I have more aws_security_group_rules it takes a lot of time. I hope this helps debug the problem better. Thanks, |
I enabled debug logs by setting - TF_LOG=DEBUG environment variable. Thanks, |
Any updates on this issue? We're hitting this on v0.6.16 regularly as well. Let me know if I can provide more information. |
I think the problem in this issue is following -
When I tried running this with parallelism=1, then things work fine. However it is still slow. Thanks, |
Same issue still in 0.7.4 |
Still the same in 0.7.6 Rules are created way faster, but the status doesn't seem to reach terraform. |
Also hitting up against this in v0.8.1 |
I think I might have figured this out, at least for the case I was encountering. I was seeing the same 5 minute duration for applying many individual aws_security_group_rule resources, but then noticed that some of my CIDR blocks were changing after they were implemented in AWS. I analyzed it a bit and noticed that I had overlapping CIDR blocks (10.5.0.0/15 and 10.4.0.0/16 in this case) and after correcting those (by splitting 10.5.0.0/15 into the proper 10.5.0.0/16 and 10.6.0.0/16 blocks) the apply ran quickly again. So, my suggestion to anyone running into this issue is to make sure you have correctly separated your CIDR blocks and they don't overlap (maybe by closing looking at what ends up in AWS compared to your Terraform definitions). |
Fixed in #11809 |
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 vesion v0.6.16
I have the following type of rules :
The sgAPPhostrules looks like below -
Command line output of the terraform apply command is as follows --
It takes 5 minutes to create one rule. We have more than 100 such rules. The other resource creation is happens comparatively fast enough.
Thanks,
-Satish
The text was updated successfully, but these errors were encountered: