-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
aws_security_group_rule: "the specified rule <rule> already exists" #6276
Comments
I originally posted this as issue#82 in terraform-aws-security-group repo but not sure if this is the better place for said issue. If this is the right place, I'll close the other issue. Thanks! |
Terraform doesn't really handle looping through lists of things where the order might change right now as you've seen. The upcoming 0.12 release should have better support for this and allow you to remove items from the middle of a list you are looping over without forcing Terraform to change every item from the indexed position until the n-1 position and delete the last element. |
Hi @PeterGrace! As mentioned above, the dynamic expression blocks added in Terraform 0.12 will probably give you a better way of handling this. I'm going to close the issue, but if you continue to run into problems please open a new bug report following the template. 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! |
I have a terraform recipe where I create via interpolation a set of security groups to authorize ssh access to our instances. When the list of addresses changes, it causes the interpolation to also change, such that all of the security_group_rules need to be deleted and recreated. Unfortunately, the new rules are trying to create while the old rules are still deleting, and I get an error message like below:
Here's a snippet of how I generate the security group rules. I set "create_before_destroy = false" on an expert's suggestion, however it has not solved the issue.
The text was updated successfully, but these errors were encountered: