forked from aztfmod/terraform-azurerm-caf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.tf
42 lines (34 loc) · 2.82 KB
/
automations.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
module "automations" {
source = "./modules/automation"
for_each = local.shared_services.automations
global_settings = local.global_settings
settings = each.value
diagnostics = local.combined_diagnostics
location = can(local.global_settings.regions[each.value.region]) ? local.global_settings.regions[each.value.region] : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group.key, each.value.resource_group_key)].location
resource_group_name = can(each.value.resource_group.name) || can(each.value.resource_group_name) ? try(each.value.resource_group.name, each.value.resource_group_name) : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group_key, each.value.resource_group.key)].name
base_tags = try(local.global_settings.inherit_tags, false) ? try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group.key, each.value.resource_group_key)].tags, {}) : {}
client_config = local.client_config
private_endpoints = try(each.value.private_endpoints, {})
remote_objects = {
managed_identities = local.combined_objects_managed_identities
vnets = local.combined_objects_networking
private_dns = local.combined_objects_private_dns
}
}
output "automations" {
value = module.automations
}
module "automation_log_analytics_links" {
source = "./modules/automation_log_analytics_links"
depends_on = [module.automations, module.log_analytics]
for_each = local.shared_services.automation_log_analytics_links
global_settings = local.global_settings
settings = each.value
resource_group_name = can(each.value.resource_group.name) || can(each.value.resource_group_name) ? try(each.value.resource_group.name, each.value.resource_group_name) : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group_key, each.value.resource_group.key)].name
workspace_id = can(each.value.workspace_id) ? each.value.workspace_id : try(local.combined_objects_log_analytics[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.workspace_key].id, local.combined_diagnostics.log_analytics[each.value.workspace_key].id)
read_access_id = try(each.value.automation_account_id, try(local.combined_objects_automations[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.automation_account_key].id, null))
write_access_id = try(each.value.write_access_id, null)
}
output "automation_log_analytics_links" {
value = module.automation_log_analytics_links
}