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 without clear resolution #23250

Closed
1 task done
tim-chaffin opened this issue Sep 12, 2023 · 3 comments · Fixed by #23260
Closed
1 task done

Comments

@tim-chaffin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

= 1.5.0, < 1.6.0

AzureRM Provider Version

3.72.0

Affected Resource(s)/Data Source(s)

azurerm_monitor_diagnostic_setting

Terraform Configuration Files

resource "azurerm_monitor_diagnostic_setting" "a_diagnostic_setting" {
  name               = "diagnostics-app"
  target_resource_id = azurerm_linux_web_app.app.id
  storage_account_id = azurerm_storage_account.stlogs01.id

  enabled_log {
    category = "AppServiceAppLogs"
    retention_policy {
      days    = 7
      enabled = true
    }
  }
}

Debug Output/Panic Output

╷
│ Warning: Argument is deprecated
│ 
│   with module.myapp.azurerm_monitor_diagnostic_setting.a_diagnostic_setting,
│   on projects/myapp/app_api.tf line 64, in resource "azurerm_monitor_diagnostic_setting" "a_diagnostic_setting":
│   64: resource "azurerm_monitor_diagnostic_setting" "a_diagnostic_setting" {
│ 
│ `retention_policy` has been deprecated - to learn more
│ https://aka.ms/diagnostic_settings_log_retention
│ 
│ (and 23 more similar warnings elsewhere)
╵

Expected Behaviour

  1. The warning message should be more explicit and state that this needs to be removed, and replaced with a new resource block, azurerm_storage_management_policy.

  2. The documentation here mentions nothing about the attribute being deprecated. Furthermore it offers no guidance in an approach to resolve the deprecation. It should make some mention that the attribute is being removed from the resource type, and is being replaced with azurerm_storage_management_policy.

Actual Behaviour

Warning message presented in plan and validate steps of Terraform.

Steps to Reproduce

terraform plan
terraform validate

Important Factoids

No response

References

No response

@rcskosir
Copy link
Contributor

Thank you for taking the time to open this issue. Please subscribe to PR #23260 which has been opened by @teowa to fix this issue.

@nkol2307
Copy link

nkol2307 commented Dec 26, 2023

any update on this?

which other resource to use instead of retention_policy is there any docs with example how this will be replace

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants