Open jantijink opened 1 year ago
Hi @jantijink, thanks for submitting this issue.
I can reproduce your provided case, and by using the terraform state show data.azurerm_monitor_diagnostic_setting.example
it looks like this:
# data.azurerm_monitor_diagnostic_categories.example:
data "azurerm_monitor_diagnostic_categories" "example" {
id = "/subscriptions/xxx/resourceGroups/wt-test-resources/providers/Microsoft.ContainerInstance/containerGroups/example-continst"
log_category_groups = []
log_category_types = []
logs = []
metrics = [
"AllMetrics",
]
resource_id = "/subscriptions/xxx/resourceGroups/wt-test-resources/providers/Microsoft.ContainerInstance/containerGroups/example-continst"
}
from above, the log
related field is empty, that's why apply or plan does not add any enabled_log
block.
By checking the Supported categories for Azure Monitor resource logs, seems the Container Group resource (with resource type Microsoft.ContainerInstance/containerGroups
) does not support export resource log through Diagnostic Setting.
From this doc, you may try using the diagnostic
field to send log to Log Analytics Workspace.
Is there an existing issue for this?
Community Note
Terraform Version
1.3.7
AzureRM Provider Version
3.54.0
Affected Resource(s)/Data Source(s)
azurerm_monitor_diagnostic_setting and azurerm_monitor_diagnostic_categories
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Creation of diagnostic setting which sends the logs to Log Analytics.
Actual Behaviour
Failure to create this resource succesfully.
Steps to Reproduce
Terraform plan and Terraform apply.
Important Factoids
Azure west europe
References
No response