Skip to content

Commit

Permalink
azurerm_orbital_spacecraft, azurerm_orbital_contact, `azurerm_orb…
Browse files Browse the repository at this point in the history
…ital_contact_profile`: Deprecate all orbital resources (#28196)

* azurerm_orbital_spacecraft, azurerm_orbital_contact, azurerm_orbital_contact_profile: Deprecate all orbital resources

* add docs
  • Loading branch information
jiaweitao001 authored Dec 6, 2024
1 parent a4a813b commit 779be09
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 5 deletions.
6 changes: 6 additions & 0 deletions internal/services/orbital/contact_profile_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ type ContactProfileResource struct{}

var _ sdk.ResourceWithUpdate = ContactProfileResource{}

var _ sdk.ResourceWithDeprecationAndNoReplacement = ContactProfileResource{}

func (r ContactProfileResource) DeprecationMessage() string {
return "The `azurerm_orbital_contact_profile` resource has been deprecated and will be removed in v5.0 of the AzureRM Provider."
}

type ContactProfileResourceModel struct {
Name string `tfschema:"name"`
ResourceGroup string `tfschema:"resource_group_name"`
Expand Down
16 changes: 16 additions & 0 deletions internal/services/orbital/contact_profile_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ 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 ContactProfileResource struct{}

func TestAccContactProfile_basic(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_contact_profile` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_contact_profile", "test")
r := ContactProfileResource{}

Expand All @@ -35,6 +39,9 @@ func TestAccContactProfile_basic(t *testing.T) {
}

func TestAccContactProfile_multipleChannels(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_contact_profile` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_contact_profile", "test")
r := ContactProfileResource{}

Expand All @@ -50,6 +57,9 @@ func TestAccContactProfile_multipleChannels(t *testing.T) {
}

func TestAccContactProfile_addChannel(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_contact_profile` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_contact_profile", "test")
r := ContactProfileResource{}

Expand All @@ -72,6 +82,9 @@ func TestAccContactProfile_addChannel(t *testing.T) {
}

func TestAccContactProfile_update(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_contact_profile` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_contact_profile", "test")
r := ContactProfileResource{}

Expand All @@ -93,6 +106,9 @@ func TestAccContactProfile_update(t *testing.T) {
}

func TestAccContactProfile_complete(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_contact_profile` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_contact_profile", "test")
r := ContactProfileResource{}

Expand Down
6 changes: 6 additions & 0 deletions internal/services/orbital/contact_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

var _ sdk.ResourceWithDeprecationAndNoReplacement = ContactResource{}

func (r ContactResource) DeprecationMessage() string {
return "The `azurerm_orbital_contact` resource has been deprecated and will be removed in v5.0 of the AzureRM Provider."
}

type ContactResource struct{}

type ContactResourceModel struct {
Expand Down
4 changes: 4 additions & 0 deletions internal/services/orbital/contact_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ 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 ContactResource struct{}

func TestAccContact_basic(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_contact` is deprecated and will be removed in 5.0")
}
skipContact(t)

data := acceptance.BuildTestData(t, "azurerm_orbital_contact", "test")
Expand Down
17 changes: 12 additions & 5 deletions internal/services/orbital/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

package orbital

import "github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
import (
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
)

type Registration struct{}

Expand All @@ -26,11 +29,15 @@ func (r Registration) DataSources() []sdk.DataSource {
}

func (r Registration) Resources() []sdk.Resource {
return []sdk.Resource{
SpacecraftResource{},
ContactProfileResource{},
ContactResource{},
if !features.FivePointOhBeta() {
return []sdk.Resource{
SpacecraftResource{},
ContactProfileResource{},
ContactResource{},
}
}

return nil
}

var _ sdk.TypedServiceRegistration = Registration{}
6 changes: 6 additions & 0 deletions internal/services/orbital/spacecraft_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ type SpacecraftResource struct{}

var _ sdk.ResourceWithUpdate = SpacecraftResource{}

var _ sdk.ResourceWithDeprecationAndNoReplacement = SpacecraftResource{}

func (r SpacecraftResource) DeprecationMessage() string {
return "The `azurerm_orbital_spacecraft` resource has been deprecated and will be removed in v5.0 of the AzureRM Provider."
}

type SpacecraftResourceModel struct {
Name string `tfschema:"name"`
ResourceGroup string `tfschema:"resource_group_name"`
Expand Down
10 changes: 10 additions & 0 deletions internal/services/orbital/spacecraft_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ 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 SpacecraftResource struct{}

func TestAccSpacecraft_basic(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_spacecraft` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_spacecraft", "test")
r := SpacecraftResource{}

Expand All @@ -35,6 +39,9 @@ func TestAccSpacecraft_basic(t *testing.T) {
}

func TestAccSpacecraft_update(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_spacecraft` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_spacecraft", "test")
r := SpacecraftResource{}

Expand All @@ -56,6 +63,9 @@ func TestAccSpacecraft_update(t *testing.T) {
}

func TestAccSpacecraft_complete(t *testing.T) {
if features.FivePointOhBeta() {
t.Skipf("Skipping since `azurerm_orbital_spacecraft` is deprecated and will be removed in 5.0")
}
data := acceptance.BuildTestData(t, "azurerm_orbital_spacecraft", "test")
r := SpacecraftResource{}

Expand Down
12 changes: 12 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ 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://learn.microsoft.com/en-us/azure/defender-for-cloud/prepare-deprecation-log-analytics-mma-agent#log-analytics-agent-autoprovisioning-experience---deprecation-plan).

### `azurerm_orbital_spacecraft`

* This deprecated resource has been retired and has been removed from the Azure Provider.

### `azurerm_orbital_contact`

* This deprecated resource has been retired and has been removed from the Azure Provider.

### `azurerm_orbital_contact_profile`

* 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 Down
2 changes: 2 additions & 0 deletions website/docs/r/orbital_contact.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ description: |-

Manages an orbital contact.

~> **Note:** The `azurerm_orbital_contact` resource has been deprecated 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/orbital_contact_profile.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ description: |-

Manages a Contact profile.

~> **Note:** The `azurerm_orbital_contact_profile` resource has been deprecated 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/orbital_spacecraft.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ description: |-

Manages a Spacecraft.

~> **Note:** The `azurerm_orbital_spacecraft` resource has been deprecated and will be removed in v5.0 of the AzureRM Provider.

## Example Usage

```hcl
Expand Down

0 comments on commit 779be09

Please sign in to comment.