Skip to content
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

Support deleting Firestore databases #6664

Conversation

modular-magician
Copy link
Collaborator

Due to backwards compatibility concerns, the default behavior remains to abandon the database upon destroy rather than to actually delete it.

To actually delete the database, you must set deletion_policy to DELETE, and apply if necessary, before running terraform destroy.

This also cleans up some related deletion-related docs and bugs:

  • Updates the delete protection docs
  • Either delete protection or deletion policy being set prevents destroy

Fixes hashicorp/terraform-provider-google#16488

Fixes hashicorp/terraform-provider-google#16404

Fixes hashicorp/terraform-provider-google#16325

Release Note Template for Downstream PRs (will be copied)

firestore: enabled database deletion upon destroy for `google_firestore_database`
firestore: added virtual field `deletion_policy` to `google_firestore_database`
firestore: prevent destruction if both `deletion_policy` is `DELETE` and `delete_protection_state` is `DELETE_PROTECTION_ENABLED`

Manual Testing notes:

delete_protection_state == enabled, policy == abandon, result: abandon
delete_protection_state == enabled, policy == delete, result == prevent
delete_protection_state == disabled, policy == abandon, result == abandon
delete_protection_state == disabled, policy == delete, result == delete

Derived from GoogleCloudPlatform/magic-modules#9450

Due to backwards compatibility concerns, the default behavior remains to
abandon the database upon destroy rather than to actually delete it.

To actually delete the database, you must set deletion_policy to DELETE,
and apply if necessary, before running `terraform destroy`.

This also cleans up some related deletion-related docs and bugs:

* Updates the delete protection docs
* delete_protection_state being enabled with deletion_policy = DELETE fails the destroy

Fixes hashicorp/terraform-provider-google#16488
Fixes hashicorp/terraform-provider-google#16404
Fixes hashicorp/terraform-provider-google#16325
[upstream:4829cc4a4f604db5d6e1d09a7c85df6250ebc19a]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 085304a into hashicorp:main Nov 21, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant