-
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
Can't destroy using modules on 0.7rc01 #7047
Comments
Hi @dbcoliveira - thanks for the report, and sorry for the trouble! Here is a full repro config that I have confirmed works in 0.6.16 and does not work on 0.7.0-rc1 or master: Config# main.tf
module "foo" {
source = "./foo"
in = "1"
}
Steps
ExpectedHappy destroy Got
|
Just confirmed the list is not required - simplifying the example above to reflect that. |
cc @jen20 FYI - planning on digging into this later but in case you get to it first. 👍 |
For `terraform destroy`, we currently build up the same graph we do for `plan` and `apply` and we do a walk with a special Diff that says "destroy everything". We have fought the interpolation subsystem time and again through this code path. Beginning in #2775 we gained a new feature to selectively prune out problematic graph nodes. The past chain of destroy fixes I have been involved with (#6557, #6599, #6753) have attempted to massage the "noop" definitions to properly handle the edge cases reported. "Variable is depended on by provider config" is another edge case we add here and try to fix. This dive only makes me more convinced that the whole `terraform destroy` code path needs to be reworked. For now, I went with a "surgical strike" approach to the problem expressed in #7047. I found a couple of issues with the existing Noop and DestroyEdgeInclude logic, especially with regards to flattening, but I'm explicitly ignoring these for now so we can get this particular bug fixed ahead of the 0.7 release. My hope is that we can circle around with a fully specced initiative to refactor `terraform destroy`'s graph to be more state-derived than config-derived. Until then, this fixes #7407
Fixed in #7131 👍 |
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. |
Hi there,
I am currently using terraform 0.7rc01 and I can't destroy something that have been applied using modules (docker provider) just seconds before.
A snippet of the module source goes like:
A snippet of the module goes as:
So applying with:
terraform apply -target=module.etcd01 -target=module.etcd02 -target=module.etcd03 -var-file=secret.tfvars
Everything goes well and confirmed that it really applies.
On the destroy part it fails big:
terraform destroy -target=module.etcd01 -target=module.etcd02 -target=module.etcd03 -var-file=secret.tfvars
Note that I know the variable list declaration implementation was introduced on 0.7 so I've actually try to perform the same code without the ipaddress list but using the actual ips. the result is the same.
Any ideas ?
Thank you for the feedback
The text was updated successfully, but these errors were encountered: