Skip to content

feat(firestore): Index delete protection on Firestore index#16233

Merged
c2thorn merged 2 commits into
GoogleCloudPlatform:mainfrom
pcostell:index-delete-protection
Feb 3, 2026
Merged

feat(firestore): Index delete protection on Firestore index#16233
c2thorn merged 2 commits into
GoogleCloudPlatform:mainfrom
pcostell:index-delete-protection

Conversation

@pcostell
Copy link
Copy Markdown
Contributor

@pcostell pcostell commented Jan 26, 2026

Add index delete protection to Firestore indexes.

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

Release Note Template for Downstream PRs (will be copied)

firestore: added `deletion_policy` 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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@NickElliot
Copy link
Copy Markdown
Contributor

With it being named as deletion_policy all should be good with future compatibility. Thanks!

Copy link
Copy Markdown
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.

LGTM with the deletion_policy swap.

wuchris-g pushed a commit to wuchris-g/magic-modules that referenced this pull request Feb 5, 2026
JianweiQ pushed a commit to JianweiQ/magic-modules that referenced this pull request Feb 20, 2026
kapoorne-g pushed a commit to kapoorne-g/magic-modules that referenced this pull request Feb 24, 2026
kefang2 pushed a commit to kefang2/magic-modules that referenced this pull request Feb 28, 2026
aditikumarii-google pushed a commit to aditikumarii-google/magic-modules that referenced this pull request Mar 10, 2026
ChuAmberZhang pushed a commit to ChuAmberZhang/magic-modules that referenced this pull request Apr 29, 2026
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.

4 participants