From e51db7dbc2b0b62a2634cd4d890ee5f01f3032b2 Mon Sep 17 00:00:00 2001 From: Elena Xin <39109137+sinbai@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:05:30 +0800 Subject: [PATCH] deprecate mixedreality (#28783) --- internal/services/mixedreality/registration.go | 17 +++++++++++++---- .../spatial_anchors_account_data_source.go | 2 ++ .../spatial_anchors_account_data_source_test.go | 5 +++++ .../spatial_anchors_account_resource.go | 3 +++ .../spatial_anchors_account_resource_test.go | 9 +++++++++ website/docs/5.0-upgrade-guide.html.markdown | 9 +++++++++ .../d/spatial_anchors_account.html.markdown | 2 ++ .../r/spatial_anchors_account.html.markdown | 2 ++ 8 files changed, 45 insertions(+), 4 deletions(-) diff --git a/internal/services/mixedreality/registration.go b/internal/services/mixedreality/registration.go index 555de8c732c1..cc53a557e8de 100644 --- a/internal/services/mixedreality/registration.go +++ b/internal/services/mixedreality/registration.go @@ -4,6 +4,7 @@ package mixedreality 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" ) @@ -30,14 +31,22 @@ func (r Registration) WebsiteCategories() []string { // SupportedDataSources returns the supported Data Sources supported by this Service func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource { - return map[string]*pluginsdk.Resource{ - "azurerm_spatial_anchors_account": dataSourceSpatialAnchorsAccount(), + dataSources := map[string]*pluginsdk.Resource{} + + if !features.FivePointOh() { + dataSources["azurerm_spatial_anchors_account"] = dataSourceSpatialAnchorsAccount() } + + return dataSources } // SupportedResources returns the supported Resources supported by this Service func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { - return map[string]*pluginsdk.Resource{ - "azurerm_spatial_anchors_account": resourceSpatialAnchorsAccount(), + resources := map[string]*pluginsdk.Resource{} + + if !features.FivePointOh() { + resources["azurerm_spatial_anchors_account"] = resourceSpatialAnchorsAccount() } + + return resources } diff --git a/internal/services/mixedreality/spatial_anchors_account_data_source.go b/internal/services/mixedreality/spatial_anchors_account_data_source.go index 7b559e2316a3..0d606fb06411 100644 --- a/internal/services/mixedreality/spatial_anchors_account_data_source.go +++ b/internal/services/mixedreality/spatial_anchors_account_data_source.go @@ -23,6 +23,8 @@ func dataSourceSpatialAnchorsAccount() *pluginsdk.Resource { return &pluginsdk.Resource{ Read: dataSourceSpatialAnchorsAccountRead, + DeprecationMessage: "The `azurerm_spatial_anchors_account` data source has been deprecated and will be removed in v5.0 of the AzureRM Provider", + Timeouts: &pluginsdk.ResourceTimeout{ Read: pluginsdk.DefaultTimeout(5 * time.Minute), }, diff --git a/internal/services/mixedreality/spatial_anchors_account_data_source_test.go b/internal/services/mixedreality/spatial_anchors_account_data_source_test.go index ec1fd9e1fd86..6150f22fd855 100644 --- a/internal/services/mixedreality/spatial_anchors_account_data_source_test.go +++ b/internal/services/mixedreality/spatial_anchors_account_data_source_test.go @@ -9,11 +9,16 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/features" ) type SpatialAnchorsAccountDataSource struct{} func TestAccSpatialAnchorsAccountDataSource_basic(t *testing.T) { + if features.FivePointOh() { + t.Skipf("Skipping since `azurerm_spatial_anchors_account` is deprecated and will be removed in 5.0") + } + data := acceptance.BuildTestData(t, "data.azurerm_spatial_anchors_account", "test") r := SpatialAnchorsAccountDataSource{} diff --git a/internal/services/mixedreality/spatial_anchors_account_resource.go b/internal/services/mixedreality/spatial_anchors_account_resource.go index b53bc28f30ad..c5956371fef7 100644 --- a/internal/services/mixedreality/spatial_anchors_account_resource.go +++ b/internal/services/mixedreality/spatial_anchors_account_resource.go @@ -26,6 +26,9 @@ func resourceSpatialAnchorsAccount() *pluginsdk.Resource { Read: resourceSpatialAnchorsAccountRead, Update: resourceSpatialAnchorsAccountUpdate, Delete: resourceSpatialAnchorsAccountDelete, + + DeprecationMessage: "The `azurerm_spatial_anchors_account` resource has been deprecated and will be removed in v5.0 of the AzureRM Provider", + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { _, err := resource.ParseSpatialAnchorsAccountID(id) return err diff --git a/internal/services/mixedreality/spatial_anchors_account_resource_test.go b/internal/services/mixedreality/spatial_anchors_account_resource_test.go index e4fc33af0e2d..129b8311e0af 100644 --- a/internal/services/mixedreality/spatial_anchors_account_resource_test.go +++ b/internal/services/mixedreality/spatial_anchors_account_resource_test.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -19,6 +20,10 @@ import ( type SpatialAnchorsAccountResource struct{} func TestAccSpatialAnchorsAccount_basic(t *testing.T) { + if features.FivePointOh() { + t.Skipf("Skipping since `azurerm_spatial_anchors_account` is deprecated and will be removed in 5.0") + } + data := acceptance.BuildTestData(t, "azurerm_spatial_anchors_account", "test") r := SpatialAnchorsAccountResource{} @@ -36,6 +41,10 @@ func TestAccSpatialAnchorsAccount_basic(t *testing.T) { } func TestAccSpatialAnchorsAccount_complete(t *testing.T) { + if features.FivePointOh() { + t.Skipf("Skipping since `azurerm_spatial_anchors_account` is deprecated and will be removed in 5.0") + } + data := acceptance.BuildTestData(t, "azurerm_spatial_anchors_account", "test") r := SpatialAnchorsAccountResource{} diff --git a/website/docs/5.0-upgrade-guide.html.markdown b/website/docs/5.0-upgrade-guide.html.markdown index a22014681ccd..3e3e4dce123e 100644 --- a/website/docs/5.0-upgrade-guide.html.markdown +++ b/website/docs/5.0-upgrade-guide.html.markdown @@ -58,6 +58,11 @@ This deprecated resource has been superseded/retired and has been removed from t * This deprecated resource has been removed from the Azure Provider. Please see the [documention for more details](https://aka.ms/AzureMapsCreatorDeprecation). +### `azurerm_spatial_anchors_account` + +* This deprecated resource has been retired and has been removed from the Azure Provider. + + ## Removed Data Sources Please follow the format in the example below for adding removed data sources: @@ -72,6 +77,10 @@ This deprecated data source has been superseded/retired and has been removed fro * The deprecated `site_config.public_network_access_enabled` property has been removed and superseded by the `public_network_access` property. +### `azurerm_spatial_anchors_account` + +* This deprecated data source has been retired and has been removed from the Azure Provider. + ## Breaking Changes in Resources Please follow the format in the example below for listing breaking changes in resources: diff --git a/website/docs/d/spatial_anchors_account.html.markdown b/website/docs/d/spatial_anchors_account.html.markdown index 082d98f1041f..e602ae075917 100644 --- a/website/docs/d/spatial_anchors_account.html.markdown +++ b/website/docs/d/spatial_anchors_account.html.markdown @@ -10,6 +10,8 @@ description: |- Get information about an Azure Spatial Anchors Account. +~> **Note:** The `azurerm_spatial_anchors_account` data source has been deprecated because the service is retiring from 2024-11-20 and will be removed in v5.0 of the AzureRM Provider. + ## Example Usage ```hcl diff --git a/website/docs/r/spatial_anchors_account.html.markdown b/website/docs/r/spatial_anchors_account.html.markdown index 9cd92b775f08..2f8b32126e63 100644 --- a/website/docs/r/spatial_anchors_account.html.markdown +++ b/website/docs/r/spatial_anchors_account.html.markdown @@ -10,6 +10,8 @@ description: |- Manages an Azure Spatial Anchors Account. +~> **Note:** The `azurerm_spatial_anchors_account` resource has been deprecated because the service is retiring from 2024-11-20 and will be removed in v5.0 of the AzureRM Provider. + ## Example Usage ```hcl