-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
log_analytics_destination_type = "AzureDiagnostics" being removed is showing up in each plan when using eventhub destintation #17779
Comments
Hello @RawPatty, I've encountered the same issue but in other circumstances. After some analysis, I found why it happens and asked a question on the Slack - https://terraform-azure.slack.com/archives/CB9RVKPDL/p1663449825271299. |
Although this is a real bug, and also happens when
Side note, you probably want "Dedicated" as it breaks the logs into multiple tables instead of one huge table inside LogAnalytics. |
I have encountered the same issue on one Azure account. Surprisingly the update is not triggered on similar other landscapes. The default is set implicitly on Azure side but the Terraform configuration does not contain the parameter in the corresponding resource, only on the affected account we get an update action (-> null). All other accounts do not detect any update, tfstate obviously does not conflict with terraform configuration. If we would add the default now to the Terraform configuration I fear that I get an update on all other Azure accounts except the one, where it is already present in tfstate. Is there no possible explanation as to why this happens and only on one account. |
It also happens if you specify resource "azurerm_monitor_diagnostic_setting" "config_keyvault" {
name = "keyvault_logging"
target_resource_id = var.kv_id
log_analytics_workspace_id = azurerm_log_analytics_workspace.ai_workspace.id
log_analytics_destination_type = "Dedicated"
enabled_log {
category_group = "allLogs"
retention_policy {
enabled = true
days = 30
}
}
enabled_log {
category_group = "audit"
retention_policy {
enabled = true
days = 30
}
}
metric {
category = "AllMetrics"
retention_policy {
enabled = true
days = 30
}
}
} Output after each apply:
|
We're seeing the same as @theadzik, could this be fixed as I'd rather not ignore changes on it. |
Seems like this issue has been fixed as a Bug Fix in the latest Azurerm version 3.45.0, this update fixed my issue after running one apply. |
Tested with terraform binary ver 1.3.9 and azure provider ver 3.45.0 and log_analytics_destination_type = "Dedicated" want to be created over and over |
Tested with tf binary 1.3.9 and azure provider 3.46.0, and I also see log_analytics_destination_type = "Dedicated" being recreated over and over again. |
Instead of using
Having said that, the provider should either throw an error if this is not supported rather than constantly providing a change… |
Tested with tf binary 1.4.2 and azure provider 3.49.0, and I also see log_analytics_destination_type = "Dedicated" being recreated over and over again. |
Tested with tf binary 1.4.5 and azure provider 3.61.0, and I also see +log_analytics_destination_type = "Dedicated" being recreated over and over again. |
This comment was marked as duplicate.
This comment was marked as duplicate.
1 similar comment
This comment was marked as duplicate.
This comment was marked as duplicate.
Stop commenting +1 on GH issues please, use reactions for that. |
Is there an existing issue for this?
Community Note
Terraform Version
1.2.6
AzureRM Provider Version
3.15
Affected Resource(s)/Data Source(s)
azurerm_monitor_diagnostic_setting
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
After applying the change, next run should show no changes required
Actual Behaviour
Terraform plan tries to remove log_analytics_destination_type = "AzureDiagnostics" setting
Steps to Reproduce
I am configuring diagnostic settings for my API Management Azure resource to send diagnostic logs to Eventhub.
Configure azurerm_monitor_diagnostic_setting to send to eventhub destination, run terraform plan again after applying the initial plan to see one change is required - log_analytics_destination_type = "AzureDiagnostics" will be removed.
After applying a change to remove log_analytics_destination_type = "AzureDiagnostics" run the plan again and observe the setting is pending again
Important Factoids
log_analytics_destination_type is an optional variable that should only be set when specifying a log analytics workspace, I'm not sure why it's being implicitly set
References
No response
The text was updated successfully, but these errors were encountered: