-
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
Destruction order for dependent providers is incorrect #4645
Comments
Hey @partamonov – do you have a configuration that demonstrates this? If you could share it (minus any secrets) that would help. Assuming you're using the interpolation for the endpoint, this should certainly work.. Thanks |
Sure, I will post. In short, I use it as
This won't create dependency. Terraform version is 0.6.9 |
|
@catsby, please see above |
Thank you @partamonov ! We'll look into this |
Related problem here (also with postgresql provider), but in our case TF graph does show the dependency, yet TF behaves as if the dependency was not there: #5340 |
Version 0.6.14
And as result I see that
Second run
|
@catsby do you have any ideas |
Fixes #4645 This is something that never worked (even in legacy graphs), but as we push forward towards encouraging multi-provider usage especially with things like the Vault data source, I want to make sure we have this right for 0.8. When you have a config like this: ``` resource "foo_type" "name" {} provider "bar" { attr = "${foo_type.name.value}" } resource "bar_type" "name" {} ``` Then the destruction ordering MUST be: 1. `bar_type` 2. `foo_type` Since configuring the client for `bar_type` requires accessing data from `foo_type`. Prior to this PR, these two would be done in parallel. This properly pushes forward the dependency. There are more cases I want to test but this is a basic case that is fixed.
I finally have a fix for this queued up in the referenced PR. :) |
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. |
Situation:
For MySQL/Postgre/MSSQL provider endpoint is created RDS.
But I found that if I'm doing
terraform destroy
RDS instance is destroyed before database on it. I checked dependency graph and found that _database resource is not linked to RDS resource. The only option here is to adddepends_on
flagShould we think how to fix dependencies or at least we should document this somewhere, may be on MySQL/Postgre/MSSQL providers pages
My graph for 2 cases in attached files:
with_depends_on.txt
without_depends_on.txt
The text was updated successfully, but these errors were encountered: