diff --git a/internal/services/securitycenter/registration.go b/internal/services/securitycenter/registration.go index 57087ed8763e..d67379d4b62b 100644 --- a/internal/services/securitycenter/registration.go +++ b/internal/services/securitycenter/registration.go @@ -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" ) @@ -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 } diff --git a/internal/services/securitycenter/security_center_auto_provisioning_resource.go b/internal/services/securitycenter/security_center_auto_provisioning_resource.go index 80e352cfc901..eea35b10953f 100644 --- a/internal/services/securitycenter/security_center_auto_provisioning_resource.go +++ b/internal/services/securitycenter/security_center_auto_provisioning_resource.go @@ -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, diff --git a/internal/services/securitycenter/security_center_auto_provisioning_resource_test.go b/internal/services/securitycenter/security_center_auto_provisioning_resource_test.go index 3734a468153a..6a0aea7e31ed 100644 --- a/internal/services/securitycenter/security_center_auto_provisioning_resource_test.go +++ b/internal/services/securitycenter/security_center_auto_provisioning_resource_test.go @@ -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{} diff --git a/website/docs/5.0-upgrade-guide.html.markdown b/website/docs/5.0-upgrade-guide.html.markdown index 2ce3bd572936..27aecb5fbcaf 100644 --- a/website/docs/5.0-upgrade-guide.html.markdown +++ b/website/docs/5.0-upgrade-guide.html.markdown @@ -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 diff --git a/website/docs/r/security_center_auto_provisioning.html.markdown b/website/docs/r/security_center_auto_provisioning.html.markdown index 95bc8297319d..f0f86e014736 100644 --- a/website/docs/r/security_center_auto_provisioning.html.markdown +++ b/website/docs/r/security_center_auto_provisioning.html.markdown @@ -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