-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
30 lines (27 loc) · 801 Bytes
/
variables.tf
File metadata and controls
30 lines (27 loc) · 801 Bytes
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
variable "tpl_local_name" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
locals {
default = {
// resource definition
tpl_local_name = {
name = ""
tags = {}
}
}
// compare and merge custom and default values
tpl_local_name_values = {
for tpl_local_name in keys(var.tpl_local_name) :
tpl_local_name => merge(local.default.tpl_local_name, var.tpl_local_name[tpl_local_name])
}
// deep merge of all custom and default values
tpl_local_name = {
for tpl_local_name in keys(var.tpl_local_name) :
tpl_local_name => merge(
local.tpl_local_name_values[tpl_local_name],
{}
)
}
}