-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Firestore deletion protection (#8906)
* Add Firestore deletion protection * Reformat * Add test for updating delete_protection_state * Make deleteProtectionState skip auto-generated tests * Add a dedicated example for delete protection
- Loading branch information
1 parent
110956f
commit 56aed36
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
mmv1/templates/terraform/examples/firestore_database_with_delete_protection.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
resource "google_firestore_database" "<%= ctx[:primary_resource_id] %>" { | ||
project = google_project.project.project_id | ||
name = "my-database" | ||
location_id = "nam5" | ||
type = "FIRESTORE_NATIVE" | ||
|
||
# Prevents accidental deletion of the database. | ||
# To delete the database, first set this field to `DELETE_PROTECTION_DISABLED`, apply the changes. | ||
# Then delete the database resource and apply the changes again. | ||
delete_protection_state = "DELETE_PROTECTION_ENABLED" | ||
|
||
depends_on = [google_project_service.firestore] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters