-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
67 lines (56 loc) · 2.38 KB
/
Copy pathmain.tf
File metadata and controls
67 lines (56 loc) · 2.38 KB
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
62
63
64
65
66
67
resource "azurerm_log_analytics_workspace" "this" {
name = var.name
resource_group_name = var.resource_group_name
location = var.location
sku = var.sku
retention_in_days = var.retention_in_days
internet_ingestion_enabled = var.internet_ingestion_enabled
internet_query_enabled = var.internet_query_enabled
local_authentication_enabled = var.local_authentication_enabled
daily_quota_gb = var.daily_quota_gb
reservation_capacity_in_gb_per_day = var.reservation_capacity_in_gb_per_day
cmk_for_query_forced = var.cmk_for_query_forced
allow_resource_only_permissions = var.allow_resource_only_permissions
immediate_data_purge_on_30_days_enabled = var.immediate_data_purge_on_30_days_enabled
data_collection_rule_id = var.data_collection_rule_id
tags = var.tags
dynamic "identity" {
for_each = var.identity != null ? [var.identity] : []
content {
type = identity.value.type
identity_ids = try(identity.value.identity_ids, null)
}
}
dynamic "timeouts" {
for_each = var.timeouts != null ? [var.timeouts] : []
content {
create = try(timeouts.value.create, null)
read = try(timeouts.value.read, null)
update = try(timeouts.value.update, null)
delete = try(timeouts.value.delete, null)
}
}
}
resource "azurerm_log_analytics_solution" "this" {
for_each = var.solutions
solution_name = each.value.solution_name
resource_group_name = var.resource_group_name
location = var.location
workspace_name = azurerm_log_analytics_workspace.this.name
workspace_resource_id = azurerm_log_analytics_workspace.this.id
plan {
publisher = each.value.plan.publisher
product = each.value.plan.product
name = try(each.value.plan.name, null)
promotion_code = try(each.value.plan.promotion_code, null)
}
}
resource "azurerm_log_analytics_data_export_rule" "this" {
for_each = var.data_export_rules
name = coalesce(each.value.name, each.key)
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.this.id
destination_resource_id = each.value.destination_resource_id
table_names = each.value.table_names
enabled = each.value.enabled
}