From 138b9fbe90e2f704219ac5480a8112ebfbaea848 Mon Sep 17 00:00:00 2001 From: Tao <104055472+teowa@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:32:34 +0800 Subject: [PATCH 1/2] enhance deprecation message --- .../services/monitor/monitor_diagnostic_setting_resource.go | 2 +- website/docs/r/monitor_diagnostic_setting.html.markdown | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/services/monitor/monitor_diagnostic_setting_resource.go b/internal/services/monitor/monitor_diagnostic_setting_resource.go index 5be8bae6c9d8..b13b6d4d5c85 100644 --- a/internal/services/monitor/monitor_diagnostic_setting_resource.go +++ b/internal/services/monitor/monitor_diagnostic_setting_resource.go @@ -129,7 +129,7 @@ func resourceMonitorDiagnosticSetting() *pluginsdk.Resource { Type: pluginsdk.TypeList, Optional: true, MaxItems: 1, - Deprecated: "`retention_policy` has been deprecated - to learn more https://aka.ms/diagnostic_settings_log_retention", + Deprecated: "`retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more https://aka.ms/diagnostic_settings_log_retention", Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "enabled": { diff --git a/website/docs/r/monitor_diagnostic_setting.html.markdown b/website/docs/r/monitor_diagnostic_setting.html.markdown index 493de7b692a6..bf60d8506264 100644 --- a/website/docs/r/monitor_diagnostic_setting.html.markdown +++ b/website/docs/r/monitor_diagnostic_setting.html.markdown @@ -159,6 +159,8 @@ A `retention_policy` block supports the following: * `enabled` - (Required) Is this Retention Policy enabled? * `days` - (Optional) The number of days for which this Retention Policy should apply. + +!> **NOTE:** `retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more information on the deprecation [in the Azure documentation](https://aka.ms/diagnostic_settings_log_retention). -> **NOTE:** Setting this to `0` will retain the events indefinitely. From 33122276a831a2dbbcab87c60d09eb9daab5816d Mon Sep 17 00:00:00 2001 From: Tao <104055472+teowa@users.noreply.github.com> Date: Thu, 14 Sep 2023 18:22:20 +0800 Subject: [PATCH 2/2] add more copy --- .../monitor/monitor_diagnostic_setting_resource.go | 14 ++++++++------ .../r/monitor_diagnostic_setting.html.markdown | 9 ++++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/internal/services/monitor/monitor_diagnostic_setting_resource.go b/internal/services/monitor/monitor_diagnostic_setting_resource.go index b13b6d4d5c85..338ebcfe66d5 100644 --- a/internal/services/monitor/monitor_diagnostic_setting_resource.go +++ b/internal/services/monitor/monitor_diagnostic_setting_resource.go @@ -168,9 +168,10 @@ func resourceMonitorDiagnosticSetting() *pluginsdk.Resource { }, "retention_policy": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Deprecated: "`retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more https://aka.ms/diagnostic_settings_log_retention", Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "enabled": { @@ -218,9 +219,10 @@ func resourceMonitorDiagnosticSetting() *pluginsdk.Resource { }, "retention_policy": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Deprecated: "`retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more https://aka.ms/diagnostic_settings_log_retention", Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "enabled": { diff --git a/website/docs/r/monitor_diagnostic_setting.html.markdown b/website/docs/r/monitor_diagnostic_setting.html.markdown index bf60d8506264..d3389703a611 100644 --- a/website/docs/r/monitor_diagnostic_setting.html.markdown +++ b/website/docs/r/monitor_diagnostic_setting.html.markdown @@ -124,6 +124,8 @@ A `log` block supports the following: * `retention_policy` - (Optional) A `retention_policy` block as defined below. +!> **NOTE:** `retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more information on the deprecation [in the Azure documentation](https://aka.ms/diagnostic_settings_log_retention). + * `enabled` - (Optional) Is this Diagnostic Log enabled? Defaults to `true`. --- @@ -140,6 +142,8 @@ An `enabled_log` block supports the following: * `retention_policy` - (Optional) A `retention_policy` block as defined below. +!> **NOTE:** `retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more information on the deprecation [in the Azure documentation](https://aka.ms/diagnostic_settings_log_retention). + --- A `metric` block supports the following: @@ -150,17 +154,20 @@ A `metric` block supports the following: * `retention_policy` - (Optional) A `retention_policy` block as defined below. +!> **NOTE:** `retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more information on the deprecation [in the Azure documentation](https://aka.ms/diagnostic_settings_log_retention). + * `enabled` - (Optional) Is this Diagnostic Metric enabled? Defaults to `true`. --- A `retention_policy` block supports the following: +!> **NOTE:** `retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more information on the deprecation [in the Azure documentation](https://aka.ms/diagnostic_settings_log_retention). + * `enabled` - (Required) Is this Retention Policy enabled? * `days` - (Optional) The number of days for which this Retention Policy should apply. -!> **NOTE:** `retention_policy` has been deprecated in favor of `azurerm_storage_management_policy` resource - to learn more information on the deprecation [in the Azure documentation](https://aka.ms/diagnostic_settings_log_retention). -> **NOTE:** Setting this to `0` will retain the events indefinitely.