-
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
Update dependency before destroy #25010
Comments
I experienced a very similar problem. In my case, each time By tainting up the chain, I was ultimately able to have a successful, single-pass Because I was able to resolve this by tainting state, it feels like there should be a way for Terraform to detect this and handle it more gracefully, subject to those dependent resources also being defined in the same Terraform module. |
@apparentlymart can you help identify whether this is essentially the same issue as #8099? |
This feels slightly different than #8099 to me, because I think this issue is describing a problem of order of operations -- both of the changes are being planned and executed, but they are happening in a different order than expected -- whereas #8099 is talking instead about generating synthetic additional actions (such as "replace" actions) based only on dependencies. |
I've not deeply investigated this yet, but I've done some initial labeling of this as a bug until we can dig into it a bit further and understand what's going on here. There is some possibility that we may find that this is behaving as intended but that the design didn't consider this particular situation, in which case we can relabel this as an enhancement once we understand what exactly the use-case is that the current design isn't catering for. |
Hi @kustodian, If I understand the situation correctly, it sounds like you're describing a use case for This ordering is also preserved when there is only a destroy operation, so that you still have the update of dependencies before the resource is destroyed. This latter part did not always work in 0.12, since it did not have the necessary dependency tracking yet, but I think it may still work in this particular case. If not, this case is definitely covered in 0.13. |
In case of destroying everything this worked even without @jbardin how do you know that this is fixed in 0.13? Where can I see the issue that fixes this? |
I just tried 0.13beta2 and when I run apply of the configuration above with
If I remove |
Thanks for testing that out @kustodian! The part of that last set of errors which is core's responsibility should be fixed in the next beta coming out soon, or you could build from master to test. If there is still an error using |
@kustodian have you had an opportunity to test this on 0.13.0? |
I just tried it and it looks like it's the same thing, here is the output of apply when I reduced the number of instances to 2:
|
This has now been reopened upstream, and I therefore believe it is a provider bug, so I'm going to mark the core issue closed. If you believe that is a mistake, please let me know! |
Could you please remove me from your mailing list? I already unsubscribed
from this repo.....
…On Sat, 19 Sep 2020 at 1:30 AM, Alisdair McDiarmid ***@***.***> wrote:
Closed #25010 <#25010>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#25010 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APWBQ3D7FSZK4FW62OUTHRTSGO367ANCNFSM4NGS3RNQ>
.
|
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 Configuration Files
I created hashicorp/terraform-provider-google#6376 in the Google provider, but I was told this is a TF issue. I'm also not sure if this issue is the same issue as #8099, so I created a new one.
In the config below the problem is when you want to lower the number of
google_compute_instance_group
that are used in agoogle_compute_region_backend_service
it's not possible because you cannot delete an instance group that is being used in a backend service.Here is an example config:
Expected Behavior
When I lower the number of instance groups (e.g. set
s1_count = 2
in the example above) TF should:google_compute_region_backend_service
(remove the last instance group from it)google_compute_instance_group
Actual Behavior
google_compute_instance_group
-> failsgoogle_compute_region_backend_service
(remove the last instance group from it)Here is the output:
Steps to Reproduce
Set
s1_count
to the lower number than before and runterraform apply
.Additional Context
Very big problem with all this is that it's not easy to fix because it requires some config hacks, running apply multiple times doesn't help.
References
The text was updated successfully, but these errors were encountered: