Provide more context to terraform providers to avoid accidental resource deletions #410
Labels
enhancement
New feature or request
upstream-protocol
Requires change of protocol specification, i.e. can't be done under the current protocol
upstream-terraform
Use-cases
Many resources in GCP are stateful and accidentally deleting them is catastrophic. Due to lack of execution context, a terraform provider may drop and recreate a resource during an update. If providers have more information on which operation was triggered (apply vs destroy), they can choose to never drop certain kinds of stateful resources on apply (e.g. databases, Kubernetes clusters, etc.).
Attempted Solutions
Users can mark their resources with
prevent_destroy = true
. However, this has 2 issues -prevent_destroy = false
) for destroy to go through since lifecycle blocks don't support interpolation.Proposal
While delegating work to a terraform provider, if more operational context can be provided (i.e. type of operation = apply vs. destroy, etc.), then provider can take the right action based on the type of resource and the user intent.
References
The text was updated successfully, but these errors were encountered: