This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
diagnostic_setting.tf
61 lines (51 loc) · 1.93 KB
/
diagnostic_setting.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
resource "azurerm_monitor_diagnostic_setting" "setting" {
for_each = var.diagnostic_setting
name = each.value.name
target_resource_id = azurerm_cognitive_account.this.id
eventhub_authorization_rule_id = each.value.eventhub_authorization_rule_id
eventhub_name = each.value.eventhub_name
log_analytics_destination_type = each.value.log_analytics_destination_type
log_analytics_workspace_id = each.value.log_analytics_workspace_id
partner_solution_id = each.value.partner_solution_id
storage_account_id = each.value.storage_account_id
dynamic "enabled_log" {
for_each = try(each.value.audit_log_retention_policy.enabled, null) == null ? [] : [1]
content {
category = "Audit"
retention_policy {
enabled = each.value.audit_log_retention_policy.enabled
days = each.value.audit_log_retention_policy.days
}
}
}
dynamic "enabled_log" {
for_each = try(each.value.request_response_log_retention_policy.enabled, null) == null ? [] : [1]
content {
category = "RequestResponse"
retention_policy {
enabled = each.value.request_response_log_retention_policy.enabled
days = each.value.request_response_log_retention_policy.days
}
}
}
dynamic "enabled_log" {
for_each = try(each.value.trace_log_retention_policy.enabled, null) == null ? [] : [1]
content {
category = "Trace"
retention_policy {
enabled = each.value.trace_log_retention_policy.enabled
days = each.value.trace_log_retention_policy.days
}
}
}
dynamic "metric" {
for_each = try(each.value.metric_retention_policy.enabled, null) == null ? [] : [1]
content {
category = "AllMetrics"
retention_policy {
enabled = each.value.metric_retention_policy.enabled
days = each.value.metric_retention_policy.days
}
}
}
}