-
Notifications
You must be signed in to change notification settings - Fork 57
/
locals.tf
39 lines (33 loc) · 1.68 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
35
36
37
38
39
locals {
composable_index_templates = merge({
for filename in var.composable_index_template_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.composable_index_templates)
indices = merge({
for filename in var.index_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.indices)
index_templates = merge({
for filename in var.index_template_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.index_templates)
ism_policies = merge({
for filename in var.ism_policy_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.ism_policies)
roles = merge({
for filename in var.role_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.roles)
role_mappings = merge({
for filename in var.role_mapping_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.role_mappings)
custom_endpoint = var.custom_endpoint != null ? var.custom_endpoint : "${var.cluster_name}.${data.aws_route53_zone.opensearch.name}"
}