Skip to content

Conversation

@Gogotchuri
Copy link
Member

Support for the new lifecycle.destroy atrribute in resource for the next OpenTofu release

@Gogotchuri Gogotchuri requested a review from a team as a code owner December 12, 2025 10:41
@Gogotchuri Gogotchuri changed the title Adds resource lifecycle.destroy support for OpenTofu 1.12 Resource lifecycle.destroy support for OpenTofu 1.12 Dec 12, 2025
Copy link
Contributor

@yottta yottta left a comment

Choose a reason for hiding this comment

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

Other than one comment loosely related with the code here, looks good.

Constraint: schema.LiteralType{Type: cty.Bool},
DefaultValue: schema.DefaultValue{Value: cty.True},
IsOptional: true,
Description: lang.Markdown(fmt.Sprintf("Setting `destroy` to `false` changes the OpenTofu's default behavior when destroying or replacing the resource. \n OpenTofu will 'forget' the resource instance, removing it from the state without destroying the actual infrastructure object. \n Read more about the `destroy` lifecycle argument in the [documentation](https://opentofu.org/docs/language/resources/behavior/#lifecycle-customizations).")),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am looking in the wrong place, but shouldn't the link here actually mention something about the destroy argument? 🤔 I cannot see it mentioned.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think I have added a separate ID to that section for the destroy attribute.
This points to the general section of the resource lifecycle customizations where the main description of the destroy attribute will be located (as a third option as I remember, but still)
If you think that would be significantly better, I can add ID in the documentation and make this reference directly tied to the destroy attribute.

Constraint: schema.LiteralType{Type: cty.Bool},
DefaultValue: schema.DefaultValue{Value: cty.True},
IsOptional: true,
Description: lang.Markdown(fmt.Sprintf("Setting `destroy` to `false` changes the OpenTofu's default behavior when destroying or replacing the resource. \n OpenTofu will 'forget' the resource instance, removing it from the state without destroying the actual infrastructure object. \n Read more about the `destroy` lifecycle argument in the [documentation](https://opentofu.org/docs/language/resources/behavior/#lifecycle-customizations).")),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Description: lang.Markdown(fmt.Sprintf("Setting `destroy` to `false` changes the OpenTofu's default behavior when destroying or replacing the resource. \n OpenTofu will 'forget' the resource instance, removing it from the state without destroying the actual infrastructure object. \n Read more about the `destroy` lifecycle argument in the [documentation](https://opentofu.org/docs/language/resources/behavior/#lifecycle-customizations).")),
Description: lang.Markdown("Setting `destroy` to `false` changes the OpenTofu's default behavior when destroying or replacing the resource. \n OpenTofu will 'forget' the resource instance, removing it from the state without destroying the actual infrastructure object. \n Read more about the `destroy` lifecycle argument in the [documentation](https://opentofu.org/docs/language/resources/behavior/#lifecycle-customizations)."),

Copy link
Member

@diofeher diofeher left a comment

Choose a reason for hiding this comment

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

Other than the small nit, looks good to me!

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