Skip to content

Update reference docs to detail universal deletion policy#17445

Merged
melinath merged 5 commits into
GoogleCloudPlatform:mainfrom
NickElliot:udprefdocs
Jun 22, 2026
Merged

Update reference docs to detail universal deletion policy#17445
melinath merged 5 commits into
GoogleCloudPlatform:mainfrom
NickElliot:udprefdocs

Conversation

@NickElliot

Copy link
Copy Markdown
Contributor

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@modular-magician

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@NickElliot NickElliot marked this pull request as ready for review May 6, 2026 21:17
@NickElliot NickElliot requested review from c2thorn and melinath May 6, 2026 21:17

@melinath melinath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've left some general stylistic / organizational feedback. I haven't tried actually building the docs & viewing them - I can do that in another round.

Comment thread docs/content/develop/client-side-fields.md Outdated
Comment thread docs/content/reference/universal-deletion-policy.md Outdated
Comment thread docs/content/reference/universal-deletion-policy.md Outdated
Comment thread docs/content/reference/universal-deletion-policy.md Outdated

# Deletion behaviors
> [!NOTE]
> **Note:** The guidance on this page has largely been superceded by the implementation of [Universal Deletion Policy]({{< ref "/reference/universal-deletion-policy" >}}). Please refer to that page for details on how to modify the standard implementation of these fields going forward. Any new specifically `deletion_protection` fields should be handled on a case by case basis.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rather than having this comment, we should remove this page (or merge it with the deletion policy page as discussed in another comment)

##Supporting a custom value for deletion_policy
If implementing support for additional values such as "FORCE", the following steps can be taken.
A `pre_delete` constant should be added to the `custom_code` block in the resource YAML file, that performs the logic with the corresponding value. Example implemention here: [#1](https://github.com/GoogleCloudPlatform/magic-modules/FEATURE-BRANCH-universal-deletion-policy/mmv1/products/datastream/PrivateConnection.yaml#L44), [#2](https://github.com/GoogleCloudPlatform/magic-modules/blob/FEATURE-BRANCH-universal-deletion-policy/mmv1/templates/terraform/pre_delete/private_connection.go.tmpl)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it's obvious, but it's important that custom deletion policies should be specifically tested. Since the expectation is that the non-custom ones won't be usually.

@modular-magician

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@modular-magician

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@NickElliot NickElliot requested a review from melinath May 19, 2026 20:58
@github-actions

Copy link
Copy Markdown

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

@melinath melinath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delayed review! There are a couple major formatting issues and then some style nits. Could you follow https://github.com/GoogleCloudPlatform/magic-modules/tree/main/docs#readme to generate locally & confirm everything looks as you expect? LMK if you run into any problems.

Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md
Comment thread docs/content/best-practices/immutable-fields.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md
```
{{< /tab >}}
{{< tab "Handwritten" >}}
All handwritten resources need to support `deletion_policy` unless deemed incompatible. The following code snippets need to be included in a resource to support this. If following steps under [Add Resource]({{< ref "/develop/add-resource/#handwritten" >}}), they should be included in your resource go file already.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for the rest of this section - could you evaluate usages of "should" per https://developers.google.com/style/prescriptive-documentation#word-choice

@github-actions

Copy link
Copy Markdown

@NickElliot, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Comment thread docs/content/best-practices/deletion-policy.md Outdated
Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
Co-authored-by: Nick Elliot <nickelliot@google.com>
@modular-magician

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@NickElliot NickElliot requested a review from melinath June 18, 2026 20:39
@NickElliot

Copy link
Copy Markdown
Contributor Author

tested locally and it renders correctly, updated all usages of should and other minor rewordings

@melinath melinath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants