-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
35 lines (29 loc) · 1.15 KB
/
main.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
locals {
default_services = yamldecode(file("default_metrics.yaml"))
}
module "aws_account_configurations" {
source = "./aws_account_configuration"
for_each = var.tenant_vars.aws_connections
tenant_vars = each.value
connection_name = each.key
default_services = local.default_services
}
module "dynatrace_management_zones" {
source = "./dynatrace_management_zones"
for_each = var.tenant_vars.management_zones
# Create one management zone per named entry under the "management_zones" block of the config.yaml
zone_vars = each.value
# Value is the attribute/parameter content of each named entry
zone_name = each.key
# Name reference for the zone within config yaml is used as the literal name of the MZ to be created
}
module "ghes_alerts" {
source = "./alerts/ghes"
count = contains(keys(var.tenant_vars), "ghes_alert") ? 1 : 0
ghes_alert_config = var.tenant_vars.ghes_alert
}
module "ghes_dashboards" {
source = "./dashboards/ghes_dashboards"
count = contains(keys(var.tenant_vars), "ghes_dashboard_hostname") ? 1 : 0
ghes_hostname = var.tenant_vars.ghes_dashboard_hostname
}