I get unwanted changes for diagnostic settings during Terraform plan. This issue was mentioned and partially resolved for most of the azurerm resources before (at least for azurerm 3.66.0). However, it still applies for Diagnostic Settings set for subresources in Storage Account.
I expect no changes during the plan, but I get such output:
module.storage.module.storage_accounts[“stga001”].azurerm_monitor_diagnostic_setting.tables_diagset[0] will be updated in-place
~ resource “azurerm_monitor_diagnostic_setting” “tables_diagset” {
id = “*****”
name = “default_tables_diagnostic_settings”
# (2 unchanged attributes hidden)- metric { - category = "Capacity" -> null - enabled = true -> null - retention_policy { - days = 0 -> null - enabled = true -> null } } - metric { - category = "Transaction" -> null - enabled = true -> null - retention_policy { - days = 0 -> null - enabled = true -> null } } + metric { + category = "AllMetrics" + enabled = true + retention_policy { + enabled = false } } # (3 unchanged blocks hidden) }
Maybe it is possible to repair this issue for this kind of objects, too.