Skip to content

Commit

Permalink
deprecate mixedreality (#28783)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai authored Feb 17, 2025
1 parent 48d4ded commit e51db7d
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 4 deletions.
17 changes: 13 additions & 4 deletions internal/services/mixedreality/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ 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"
)

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{}

Expand All @@ -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{}

Expand Down
9 changes: 9 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/spatial_anchors_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/spatial_anchors_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e51db7d

Please sign in to comment.