Skip to content

Conversation

@pcostell
Copy link
Contributor

Add index delete protection to Firestore indexes.

When set to true, Firestore will reject deletion of index resources from terraform until set to false.

Release Note Template for Downstream PRs (will be copied)

firestore: added `delete_protection` virtual field to `google_firestore_index` resource

@github-actions github-actions bot requested a review from c2thorn January 26, 2026 23:28
@github-actions
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 34 files changed, 147 insertions(+), 30 deletions(-))
google-beta provider: Diff ( 38 files changed, 151 insertions(+), 34 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 709
Passed tests: 655
Skipped tests: 52
Affected tests: 2

Click here to see the affected service packages
  • colab
  • dataprocgdc
  • datastream
  • edgenetwork
  • oracledatabase
  • apihub
  • clouddomains
  • databasemigrationservice
  • mlengine
  • networksecurity
  • networkservices
  • securesourcemanager
  • dataproc
  • developerconnect
  • firebaseapphosting
  • firestore
  • networkconnectivity
  • transcoder
  • beyondcorp
  • bigquery
  • certificatemanager
  • saasruntime

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccColabRuntime_update
  • TestAccFirestoreIndex_firestoreIndexDeleteProtectionExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccColabRuntime_update [Debug log]
TestAccFirestoreIndex_firestoreIndexDeleteProtectionExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@github-actions
Copy link

@c2thorn This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

@GoogleCloudPlatform/terraform-team @c2thorn This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pcostell,
We have a project to add universal deletion protection that is being worked on right now: hashicorp/terraform-provider-google#25072

It's a large change, I don't have an ETA for it, but it's a priority item for our team this quarter. Looking at the implementation you've created here, it would cover the behavior, just in a deletion_policy field instead of deletion_protection

In order to avoid duplicate fields and implementations, would it be servicable to wait for the universal option?

@pcostell
Copy link
Contributor Author

pcostell commented Feb 3, 2026

Thanks @c2thorn , that's great to hear. Given indexing can take hours and can have a major impact on customer workloads, I'd prefer not waiting if we don't have a close ETA.

I'm wondering if I could migrate this to a deletion_policy field for Firestore with the same semantics as the universal version, then we could just swap it out when it is ready?

@github-actions github-actions bot requested a review from c2thorn February 3, 2026 03:37
Change-Id: Id285310cbb1d95ea899653d15726e1886e9f51b8
@pcostell pcostell force-pushed the index-delete-protection branch 2 times, most recently from 3fe9107 to 308e63f Compare February 3, 2026 04:01
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 110 insertions(+))
google-beta provider: Diff ( 4 files changed, 110 insertions(+))

@modular-magician
Copy link
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccFirestoreIndex_firestoreIndexDeletionPolicyExample

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • firestore

🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

Change-Id: I2e8382d15b9aa654e70047a4ea5edfe47ac47328
@pcostell pcostell force-pushed the index-delete-protection branch from 308e63f to 8bd0d26 Compare February 3, 2026 04:31
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 114 insertions(+))
google-beta provider: Diff ( 4 files changed, 114 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 32
Passed tests: 31
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • firestore

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccFirestoreIndex_firestoreIndexDeletionPolicyExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccFirestoreIndex_firestoreIndexDeletionPolicyExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants