with one click
deprecate-resource
// Assist in deprecating an existing resource or data source, following the provider's breaking changes guide.
// Assist in deprecating an existing resource or data source, following the provider's breaking changes guide.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | deprecate-resource |
| description | Assist in deprecating an existing resource or data source, following the provider's breaking changes guide. |
| triggers | ["deprecate resource","remove resource in 5.0","retire service"] |
This skill assists in deprecating a resource or data source that will be removed in the next major version.
For Native (Pluginsdk) Resources:
Set the DeprecationMessage in the resource definition.
DeprecationMessage: "The `azurerm_example` resource has been deprecated and will be removed in the next major version of the Provider"
For Typed Resources:
Implement sdk.ResourceWithDeprecationAndNoReplacement or sdk.ResourceWithDeprecationReplacedBy.
func (r ExampleResource) DeprecationMessage() string {
return "The `azurerm_example` resource has been deprecated and will be removed in the next major version of the Provider"
}
In the service's registration.go, wrap the resource registration with the major version feature flag.
if !features.NextMajorVersion() {
resources = append(resources, ExampleResource{})
}
Conditionally skip tests in the test file.
if features.NextMajorVersion() {
t.Skipf("Skipping since `azurerm_example` is deprecated and will be removed in the next major version")
}
Note: If the Azure API no longer works, remove the test file entirely.
Note to the resource documentation (website/docs/r/*.html.markdown).website/docs/5.0-upgrade-guide.markdown) under ## Removed Resources.features.NextMajorVersion()) for conditional logic.terraform-provider-azurerm/contributing/topics/guide-breaking-changes.md if working on AzureRM).When you modify a file that contains Terraform configuration (e.g., acceptance tests, markdown documentation), you MUST run the terrafmt fmt -f <file> command on the file to ensure the configuration meets Terraform's formatting standards.