From 08705f049cf9b8cdbb856839b0be1cfc80c4fa2f Mon Sep 17 00:00:00 2001 From: Tao <104055472+teowa@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:41:55 +0800 Subject: [PATCH] `azurerm_media*` - mark deprecated as service is being retired (#22350) --- internal/services/media/media_asset_filter_resource.go | 2 ++ internal/services/media/media_asset_resource.go | 2 ++ .../services/media/media_content_key_policy_resource.go | 2 ++ internal/services/media/media_job_resource.go | 2 ++ internal/services/media/media_live_output_resource.go | 2 ++ .../media/media_service_account_filter_resource.go | 7 +++++++ internal/services/media/media_services_account_resource.go | 2 ++ .../services/media/media_streaming_endpoint_resource.go | 2 ++ .../services/media/media_streaming_live_event_resource.go | 2 ++ .../services/media/media_streaming_locator_resource.go | 2 ++ internal/services/media/media_streaming_policy_resource.go | 2 ++ internal/services/media/media_transform_resource.go | 2 ++ internal/services/media/registration.go | 4 ++++ 13 files changed, 33 insertions(+) diff --git a/internal/services/media/media_asset_filter_resource.go b/internal/services/media/media_asset_filter_resource.go index 94e468ee9907..d69b061d1a90 100644 --- a/internal/services/media/media_asset_filter_resource.go +++ b/internal/services/media/media_asset_filter_resource.go @@ -24,6 +24,8 @@ func resourceMediaAssetFilter() *pluginsdk.Resource { Update: resourceMediaAssetFilterCreateUpdate, Delete: resourceMediaAssetFilterDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_asset_resource.go b/internal/services/media/media_asset_resource.go index e51bcf0125fa..0a906ef24a00 100644 --- a/internal/services/media/media_asset_resource.go +++ b/internal/services/media/media_asset_resource.go @@ -26,6 +26,8 @@ func resourceMediaAsset() *pluginsdk.Resource { Update: resourceMediaAssetCreateUpdate, Delete: resourceMediaAssetDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_content_key_policy_resource.go b/internal/services/media/media_content_key_policy_resource.go index 176b63e92583..d65b96c54195 100644 --- a/internal/services/media/media_content_key_policy_resource.go +++ b/internal/services/media/media_content_key_policy_resource.go @@ -28,6 +28,8 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { Update: resourceMediaContentKeyPolicyCreateUpdate, Delete: resourceMediaContentKeyPolicyDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_job_resource.go b/internal/services/media/media_job_resource.go index 4e43ef06f1ba..fa4d0545b389 100644 --- a/internal/services/media/media_job_resource.go +++ b/internal/services/media/media_job_resource.go @@ -26,6 +26,8 @@ func resourceMediaJob() *pluginsdk.Resource { Update: resourceMediaJobUpdate, Delete: resourceMediaJobDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_live_output_resource.go b/internal/services/media/media_live_output_resource.go index d15960c59b0e..8d371859cea7 100644 --- a/internal/services/media/media_live_output_resource.go +++ b/internal/services/media/media_live_output_resource.go @@ -26,6 +26,8 @@ func resourceMediaLiveOutput() *pluginsdk.Resource { Read: resourceMediaLiveOutputRead, Delete: resourceMediaLiveOutputDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_service_account_filter_resource.go b/internal/services/media/media_service_account_filter_resource.go index 742f7aaa7a58..dc2c4e740fd1 100644 --- a/internal/services/media/media_service_account_filter_resource.go +++ b/internal/services/media/media_service_account_filter_resource.go @@ -14,6 +14,9 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/utils" ) +var _ sdk.ResourceWithUpdate = AccountFilterResource{} +var _ sdk.ResourceWithDeprecationAndNoReplacement = AccountFilterResource{} + type AccountFilterModel struct { Name string `tfschema:"name"` ResourceGroupName string `tfschema:"resource_group_name"` @@ -44,6 +47,10 @@ type Condition struct { type AccountFilterResource struct{} +func (r AccountFilterResource) DeprecationMessage() string { + return azureMediaRetirementMessage +} + func (r AccountFilterResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { diff --git a/internal/services/media/media_services_account_resource.go b/internal/services/media/media_services_account_resource.go index 5a9e22f85057..797e98d87493 100644 --- a/internal/services/media/media_services_account_resource.go +++ b/internal/services/media/media_services_account_resource.go @@ -33,6 +33,8 @@ func resourceMediaServicesAccount() *pluginsdk.Resource { Update: resourceMediaServicesAccountCreateUpdate, Delete: resourceMediaServicesAccountDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_streaming_endpoint_resource.go b/internal/services/media/media_streaming_endpoint_resource.go index 1ca2c968a870..4d60520d48c5 100644 --- a/internal/services/media/media_streaming_endpoint_resource.go +++ b/internal/services/media/media_streaming_endpoint_resource.go @@ -29,6 +29,8 @@ func resourceMediaStreamingEndpoint() *pluginsdk.Resource { Update: resourceMediaStreamingEndpointUpdate, Delete: resourceMediaStreamingEndpointDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_streaming_live_event_resource.go b/internal/services/media/media_streaming_live_event_resource.go index 2017f709d53b..aeedfd8a44d8 100644 --- a/internal/services/media/media_streaming_live_event_resource.go +++ b/internal/services/media/media_streaming_live_event_resource.go @@ -28,6 +28,8 @@ func resourceMediaLiveEvent() *pluginsdk.Resource { Update: resourceMediaLiveEventUpdate, Delete: resourceMediaLiveEventDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_streaming_locator_resource.go b/internal/services/media/media_streaming_locator_resource.go index 314441fdd57d..9b7ffb43904d 100644 --- a/internal/services/media/media_streaming_locator_resource.go +++ b/internal/services/media/media_streaming_locator_resource.go @@ -26,6 +26,8 @@ func resourceMediaStreamingLocator() *pluginsdk.Resource { Read: resourceMediaStreamingLocatorRead, Delete: resourceMediaStreamingLocatorDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_streaming_policy_resource.go b/internal/services/media/media_streaming_policy_resource.go index 7a14800d5658..923c14b6e428 100644 --- a/internal/services/media/media_streaming_policy_resource.go +++ b/internal/services/media/media_streaming_policy_resource.go @@ -26,6 +26,8 @@ func resourceMediaStreamingPolicy() *pluginsdk.Resource { Read: resourceMediaStreamingPolicyRead, Delete: resourceMediaStreamingPolicyDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/media_transform_resource.go b/internal/services/media/media_transform_resource.go index f38be50cabdc..7a80252a768a 100644 --- a/internal/services/media/media_transform_resource.go +++ b/internal/services/media/media_transform_resource.go @@ -28,6 +28,8 @@ func resourceMediaTransform() *pluginsdk.Resource { Update: resourceMediaTransformCreateUpdate, Delete: resourceMediaTransformDelete, + DeprecationMessage: azureMediaRetirementMessage, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/media/registration.go b/internal/services/media/registration.go index f9addeb8e87d..5b989ed8ace2 100644 --- a/internal/services/media/registration.go +++ b/internal/services/media/registration.go @@ -12,6 +12,10 @@ var ( _ sdk.UntypedServiceRegistrationWithAGitHubLabel = Registration{} ) +const ( + azureMediaRetirementMessage = "Azure Media Services will be retired June 30th, 2024. Please see https://learn.microsoft.com/en-us/azure/media-services/latest/azure-media-services-retirement" +) + func (r Registration) AssociatedGitHubLabel() string { return "service/media" }