-
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
Instance cannot be destroyed message should say why resource needs to be destroyed or recreated #22264
Comments
For my point of view, it's a bug. It is nessesary to see witch reason causes deletion. |
I just encountered this bug using a Terraform 0.12.24 resource through ConcourseCI. It was managing an existing GKE cluster with The terraform could definitely output the change reason at the point it errored. |
Just started writing this up separately and then of course found this when putting together references. I'll add my details here. Current Terraform Version
Use-casesCurrently if a plan requires a resource to by destroyed, and that resource has
Attempted SolutionsN/A ProposalWhere a resource meets the above requirements, the failure should provide sufficient information to determine the cause of the attempt to destroy the resource. This would then provide details as to whether the attempt is required – and an alternative pathway is needed to resolve the issue – or if it is invalid and needs to be corrected before successfully applying the actual desired changes. ReferencesRelated issues raised (which go beyond the scope of this proposal): |
Current Terraform Version
Use-cases
When I have the
prevent_destroy
option enabled, and I make a change to config that would require the resource to be created,terraform plan
doesn't tell me which change would result in the resource getting recreated. However, ifprevent_destroy
is not enabled, then it informs me of which attribute(s) results in the resource getting recreated.Attempted Solutions
I can see the information I want by temporarily removing the
prevent_destroy
option, running and plan, and putting it back, but it is quite a pain to do that.Proposal
In the case that a destroy is prevented, output the diff as if it would be destroyed in the plan phase
The text was updated successfully, but these errors were encountered: