-
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
Destroy doesn't respect module dependencies correctly #1582
Comments
This might be a dupe of #922 |
Thanks for putting the work in to provide us with a detailed example, @rubbish - this will help us a lot with the debugging process. Tagged and we'll take a look. |
I think this is another example where we need to expand modules out in the same graph and this would just get fixed. |
This is fixed now in my branch. I'll PR soon. |
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. |
I've ran into an issue similar to #1472 and I think i've distilled it to a simple example.
This is on the current master of terraform:
Given a configuration:
./main.tf
./a_module/main.tf
On apply, it should bring up
a_module.null_resource.a
before it brings uproot.null_resource.b
and on destroy, it should destroyb
beforea
by respecting the dependency.So on apply I get:
Good there..
In the
terraform.tfstate
, I have:But when I destroy:
It's destroying
a
beforeb
, which I wouldn't expect. This has led to problems in which a module that we depend on creates something which we add to it in our own config. But when we destroy, the service behind the "parent" blows up because it's not empty. If destroyed the leaves first, it wouldn't have this problem.The text was updated successfully, but these errors were encountered: