You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform 0.12 removes depends_on from state file on resources that failed to delete. I'm not sure if that is exactly the problem, but it looks like that is the issue.
Which basically creates a top level folder and in it Prod, Test and Dev folders. After this there is more configuration that creates projects, etc, but that is not that important for this problem. So if I comment out the structure-team from main.tf and run terraform apply it should deleted all those folders and everything in them, but what happens is that folders Prod, Test and Dev don't get deleted (I guess its because of the same issue which I'm describing here). Then if I run apply again it TF tells me that it's going to delete these 4 folders because there is nothing else left, but what happens is that TF tries to delete all 4 folders at the same time, so deleting the top level folder fails and I have to run apply one more time so that it gets deleted.
What I found out is that in the state file this happens. Here is the Dev folder before running the first apply:
TF should have deleted all 4 folders in the correct order.
Actual Behavior
TF tries to deleted them all at the same time, even though they have implicit dependencies.
Steps to Reproduce
Not 100% sure, because by just creating these 4 folders is not enough for TF to fail with this.
Additional Context
What is very interesting is that if I run terraform destroy on everything, all gets deleted without any issues. But by just deleting part of the code and running apply, it fails.
The text was updated successfully, but these errors were encountered:
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.
ghost
locked and limited conversation to collaborators
Mar 29, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugcorev0.12Issues (primarily bugs) reported against v0.12 releases
Terraform 0.12 removes
depends_on
from state file on resources that failed to delete. I'm not sure if that is exactly the problem, but it looks like that is the issue.Terraform Version
Terraform Configuration Files
In my main.tf I have this code which calls a module:
And in that module at the top we have:
Which basically creates a top level folder and in it Prod, Test and Dev folders. After this there is more configuration that creates projects, etc, but that is not that important for this problem. So if I comment out the
structure-team
frommain.tf
and runterraform apply
it should deleted all those folders and everything in them, but what happens is that folders Prod, Test and Dev don't get deleted (I guess its because of the same issue which I'm describing here). Then if I run apply again it TF tells me that it's going to delete these 4 folders because there is nothing else left, but what happens is that TF tries to delete all 4 folders at the same time, so deleting the top level folder fails and I have to run apply one more time so that it gets deleted.What I found out is that in the state file this happens. Here is the Dev folder before running the first apply:
As you can see there is a
depends_on
, but after I run the first apply, this Dev folder looks like this:For some reason
depends_on
is removed.Expected Behavior
TF should have deleted all 4 folders in the correct order.
Actual Behavior
TF tries to deleted them all at the same time, even though they have implicit dependencies.
Steps to Reproduce
Not 100% sure, because by just creating these 4 folders is not enough for TF to fail with this.
Additional Context
What is very interesting is that if I run
terraform destroy
on everything, all gets deleted without any issues. But by just deleting part of the code and running apply, it fails.The text was updated successfully, but these errors were encountered: