diff --git a/internal/services/monitor/monitor_diagnostic_setting_resource.go b/internal/services/monitor/monitor_diagnostic_setting_resource.go index 5be8bae6c9d8..338ebcfe66d5 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": { @@ -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 493de7b692a6..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,15 +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:** Setting this to `0` will retain the events indefinitely.