Skip to content

Commit

Permalink
azurerm_security_center_auto_provisioning - deprecate resource (#28030
Browse files Browse the repository at this point in the history
)

* `azurerm_security_center_auto_provisioning` - deprecate resource

* update 5.0 upgrade document

* update per document

* typo
  • Loading branch information
ziyeqf authored Nov 18, 2024
1 parent cac13c0 commit 8562726
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/services/securitycenter/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package securitycenter

import (
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)
Expand Down Expand Up @@ -49,11 +50,14 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource {
"azurerm_security_center_subscription_pricing": resourceSecurityCenterSubscriptionPricing(),
"azurerm_security_center_workspace": resourceSecurityCenterWorkspace(),
"azurerm_security_center_automation": resourceSecurityCenterAutomation(),
"azurerm_security_center_auto_provisioning": resourceSecurityCenterAutoProvisioning(),
"azurerm_security_center_server_vulnerability_assessments_setting": resourceSecurityCenterServerVulnerabilityAssessmentsSetting(),
"azurerm_security_center_server_vulnerability_assessment_virtual_machine": resourceServerVulnerabilityAssessmentVirtualMachine(),
}

if !features.FivePointOhBeta() {
resources["azurerm_security_center_auto_provisioning"] = resourceSecurityCenterAutoProvisioning()
}

return resources
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func resourceSecurityCenterAutoProvisioning() *pluginsdk.Resource {
Delete: pluginsdk.DefaultTimeout(60 * time.Minute),
},

DeprecationMessage: "The `azurerm_security_center_auto_provisioning` resource has been deprecated and will be removed in v5.0 of the AzureRM Provider",

Schema: map[string]*pluginsdk.Schema{
"auto_provision": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
type SecurityCenterAutoProvisionResource struct{}

func TestAccSecurityCenterAutoProvision_update(t *testing.T) {
t.Skipf("Skipping since `azurerm_security_center_auto_provisioning` is deprecated on service side, can no longer be enabled.")
data := acceptance.BuildTestData(t, "azurerm_security_center_auto_provisioning", "test")
r := SecurityCenterAutoProvisionResource{}

Expand Down
3 changes: 3 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Please follow the format in the example below for adding removed resources:
This deprecated resource has been superseded/retired and has been removed from the Azure Provider.
```

### `azurerm_security_center_auto_provisioning`

* This deprecated resource has been removed from the Azure Provider. Please see the [documention for more details](https://learn.microsoft.com/en-us/azure/defender-for-cloud/prepare-deprecation-log-analytics-mma-agent#log-analytics-agent-autoprovisioning-experience---deprecation-plan).

## Removed Data Sources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ description: |-

Enables or disables the Security Center Auto Provisioning feature for the subscription

~> **Note:** The `azurerm_security_center_auto_provisioning` resource has been deprecated because [the auto provisioning capability will be deprecated by end of Novemember of 2024](https://learn.microsoft.com/en-us/azure/defender-for-cloud/prepare-deprecation-log-analytics-mma-agent#log-analytics-agent-autoprovisioning-experience---deprecation-plan) and will be removed in v5.0 of the AzureRM Provider.

~> **NOTE:** There is no resource name required, it will always be "default"

## Example Usage
Expand Down

0 comments on commit 8562726

Please sign in to comment.