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 #16576

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 #16488

Fixes #16404

Fixes #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#16488
Fixes hashicorp#16404
Fixes hashicorp#16325
[upstream:4829cc4a4f604db5d6e1d09a7c85df6250ebc19a]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit 2e84b0e into hashicorp:main Nov 21, 2023
2 checks passed
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant