-
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
Recreating lost resources does not work when resources are referenced by other resources using array element syntax #14536
Comments
Hi again @sigmunau! Sorry for the delay in getting back to you here. There were some fixes in this area included in 0.9.6, but looking at this again with the existing fixes in mind I'm suspecting that this is something different than what we fixed already. If you're able, it'd be useful if you could retry this with the official 0.9.6 release and let me know if it's still broken and, if it is, whether there are any differences in the error messages produced. (It's possible that changes may have affected exactly how this manifests, even if they didn't fix it.) |
Hi, This appears to be affecting me on Terraform 0.9.6 official release.
Changing to an Also the same code, using array syntax, worked fine in Terraform 0.9.3. |
Thanks for the confirmation, @rlees85! I'll see if I can repro this and get it fixed. |
Thanks for the reply. I see this still seems to be an issue in Terraform 0.9.11. Below is a really cut down example of how to re-create the issue:
Steps:
Observe it wants to re-create all 3 volume attachments (for all 3 instances). This would cause a disruption in service in an environment where if a server got terminated then all other production servers had a filesystem ripped out and re-attached. Running a Terraform Apply does indeed rip out the attachments and re-create them for ALL instances. Terraform 0.9.3 worked fine... Output from plan:
|
I've encountered similar behavior using Terraform 0.9.11 and |
This is impacting me quite badly when creation of a resource fails. Subsequent applies hit this index out of range error. Still seems to be an issue in TF 0.10. |
Also related. Hitting me quite hard again now too. Even with resources that don't use a count. Data sources run with against the current state not the target state EVEN if there is a direct input into the module from the prerequisite module. i.e.
my_security_group_rule has a data source that resolves the security group ID by the name. This is so things can be decoupled. First run works, if you change the input |
Are there any workarounds to this? I am on Terraform v0.11.1. I do not use modules at all. |
Halp! I can't figure this out. I removed the .terraform folder by accident and started receiving the same error. I've never had this issue before and have not modified any code related to the VPC and now I cant update simple stuff in my production account. Any hel[p would be greatly appreciated. thanks |
To give me detail. I am outputing this from the VPC module
and ingesting it like this
|
The element |
Hello! 🤖 This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it. If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform. 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 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
Terraform v0.9.6-dev
Terraform v0.9.5
Affected Resource(s)
Please list the resources as a list, for example:
(probably a core issue)
Terraform Configuration Files
Debug Output
https://gist.github.com/sigmunau/0c3c698bb26ec7835f146b5e49b34c3b
Expected Behavior
terraform refresh
should work.terraform plan
should indicate that missing node will get recreatedActual Behavior
Both
terraform refresh
andterraform plan
fails with the following error:Steps to Reproduce
terraform apply
terraform refresh
orterraform plan
Important Factoids
Replacing array syntax with element() function (as shown in comments in code) gives the desired behaviour. Changing
worker_count
does not trigger the problemReferences
The text was updated successfully, but these errors were encountered: