Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_monitor_diagnostic_setting - retention_policy deprecated in favor of azurerm_storage_management_policy #23260

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
9 changes: 9 additions & 0 deletions website/docs/r/monitor_diagnostic_setting.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

---
Expand All @@ -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:
Expand All @@ -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.

Expand Down