-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.diagnostic_settings.tf
34 lines (28 loc) · 1.03 KB
/
main.diagnostic_settings.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
resource "azurerm_monitor_diagnostic_setting" "this_vm_diags" {
for_each = var.diagnostic_settings
name = each.value.name
target_resource_id = local.virtualmachine_resource_id
eventhub_authorization_rule_id = each.value.event_hub_authorization_rule_resource_id
log_analytics_destination_type = each.value.log_analytics_destination_type == "Dedicated" ? null : each.value.log_analytics_destination_type
log_analytics_workspace_id = each.value.workspace_resource_id
partner_solution_id = each.value.marketplace_partner_resource_id
storage_account_id = each.value.storage_account_resource_id
dynamic "enabled_log" {
for_each = each.value.log_categories
content {
category = enabled_log.value
}
}
dynamic "enabled_log" {
for_each = each.value.log_groups
content {
category_group = enabled_log.value
}
}
dynamic "metric" {
for_each = each.value.metric_categories
content {
category = metric.value
}
}
}