-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 destroys other resources when resources created by Count #18609
Comments
hi @neeleshg, I'm sorry for the long silence, this issue slipped past me. Are you still having this issue, by any chance, or were you able to figure it out? |
Hi @mildwonkey Regards |
Hi @mildwonkey What's the status on this issue? |
It's not really possible to comment on this issue without a complete reproduction case and the output of trace logs; our documentation for Several bugs have been fixed since this time as well, so I am going to close this issue, but if anyone is still experiencing a problem while using terraform v0.13, please open a new issue and fill out the issue template entirely. |
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 Version
Problem Description
I have created multiple aws instances with terraform with the help of Count.
When I try to destroy 1 single aws instance, it also deletes the resources related with other instances.
In below example, if I try to delete resource aws_instance.ca[1], it also tries to delete aws_volume_attachment.ca_attach_data_disk[0] along with aws_volume_attachment.ca_attach_data_disk[1].
Similarly for NLB Target Group attachment and CloudWatch monitors.
Terraform Configuration Files
aws_instance.tf
Expected Behavior
Actual Behavior
Steps to Reproduce
Run
Additional Context
I did not use element() to refer instance_id and volume_id as I found issue with them also.
Then I changed my code according to #3449
The text was updated successfully, but these errors were encountered: