hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.27k stars 1.72k forks source link

Change `google_compute_instance` `deletion_protection` default to `true` #15368

Open rileykarson opened 1 year ago

rileykarson commented 1 year ago

Community Note

Description

Note: I'm filing this, but I'm not entirely sure we should do it- a GCE instance is not always storing data that will be lost on accidental deletion, much less than a database product or even a GKE cluster.

This was added in https://github.com/hashicorp/terraform-provider-google/pull/1205, and maps to https://cloud.google.com/compute/docs/instances/preventing-accidental-vm-deletion. Every other deletion_protection field I'm aware of started as a client-only field that defaults to true, starting with google_bigtable_instance and proliferating across other databases. We may want to consider making it consistent with that practice.

New or Affected Resource(s)

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

References

b/312433119

bschaatsbergen commented 1 year ago

I think it would be nice to have such a practice in place, where we default to true for any deletion protection support. Though there's a significant impact to existing resources, something for a new major version to address across all resources?