-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocals.tf
34 lines (31 loc) · 1.41 KB
/
locals.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
locals {
kubeconfig_filename = abspath(pathexpand(var.kubeconfig_filename))
api_endpoint = digitalocean_kubernetes_cluster.cluster.kube_config.0.host
token = digitalocean_kubernetes_cluster.cluster.kube_config.0.token
certificate_authority_data = base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.cluster_ca_certificate)
client_certificate_data = base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.client_certificate)
client_key_data = base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.client_key)
#suffix = random_string.suffix.result
#secret = random_string.secret.result
modules_result = {
for name, config in merge(var.modules, local.modules) : name => merge(config, {
output : config.enabled ? lookup(local.register_modules, name, try(config.output, tomap({}))) : tomap({})
})
}
manifests_template_vars = merge(
{
doks : {
region : var.region
vpc_uuid : var.vpc_uuid
}
},
var.manifests_template_vars,
{
alertmanager_cronitor_id : var.cronitor_id
alertmanager_opsgenie_integration_api_key : var.opsgenie_integration_api_key
modules : local.modules_result
},
module.teleport-agent.teleport_agent_config,
{ for k, v in var.manifests_template_vars : k => v if k != "modules" }
)
}