-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathvariables.json
More file actions
115 lines (115 loc) · 3.62 KB
/
variables.json
File metadata and controls
115 lines (115 loc) · 3.62 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"variable": [
{
"region": {}
},
{
"account": {}
},
{
"azs": {
"default": {
"us-west-1": "us-west-1c,us-west-1b",
"us-west-2": "us-west-2c,us-west-2b,us-west-2a",
"us-east-1": "us-east-1c,us-east-1b,us-east-1a",
"eu-central-1": "eu-central-1a,eu-central-1b,eu-central-1c",
"sa-east-1": "sa-east-1a,sa-east-1c",
"ap-northeast-1": "ap-northeast-1a,ap-northeast-1c,ap-northeast-1d",
"ap-southeast-1": "ap-southeast-1a,ap-southeast-1b,ap-southeast-1c",
"ap-southeast-2": "ap-southeast-2a,ap-southeast-2b,ap-southeast-2c"
}
}
},
{
"options": {
"type": "string",
"default": {}
}
},
{
"var_with_validation": {
"type": "${list(object({\"id\": \"string\", \"nested\": \"${list(object({\"id\": \"string\", \"type\": \"string\"}))}\"}))}",
"validation": [
{
"condition": "${!contains([for v in flatten(var.var_with_validation[*].id) : can(regex(\"^(A|B)$\", v))], false)}",
"error_message": "The property `id` must be one of value [A, B]."
},
{
"condition": "${!contains([for v in flatten(var.var_with_validation[*].nested[*].type) : can(regex(\"^(A|B)$\", v))], false)}",
"error_message": "The property `nested.type` must be one of value [A, B]."
}
]
}
}
],
"locals": [
{
"foo": "${var.account}_bar",
"bar": {
"baz": 1,
"${(var.account)}": 2
},
"tuple": ["${local.foo}"],
"empty_tuple": []
},
{
"route53_forwarding_rule_shares": "${{for forwarding_rule_key in keys(var.route53_resolver_forwarding_rule_shares) : \"${forwarding_rule_key}\" => {\"aws_account_ids\": \"${[for account_name in var.route53_resolver_forwarding_rule_shares[forwarding_rule_key].aws_account_names : module.remote_state_subaccounts.map[account_name].outputs[\"aws_account_id\"]]}\"}}}",
"has_valid_forwarding_rules_template_inputs": "${(length(keys(var.forwarding_rules_template.copy_resolver_rules)) > 0 && length(var.forwarding_rules_template.replace_with_target_ips) > 0 && length(var.forwarding_rules_template.exclude_cidrs) > 0)}",
"for_whitespace": "${{for i in [1, 2, 3] : i => i}}"
},
{
"nested_data": [
{
"id": 1,
"nested": [
{
"id": "a",
"again": [
{
"id": "a1"
},
{
"id": "b1"
}
]
},
{
"id": "c"
}
]
},
{
"id": 1,
"nested": [
{
"id": "a",
"again": [
{
"id": "a2"
},
{
"id": "b2"
}
]
},
{
"id": "b",
"again": [
{
"id": "a"
},
{
"id": "b"
}
]
}
]
}
],
"ids_level_1": "${distinct(local.nested_data[*].id)}",
"ids_level_2": "${flatten(local.nested_data[*].nested[*].id)}",
"ids_level_3": "${flatten(local.nested_data[*].nested[*].again[*][0].foo.bar[0])}",
"bindings_by_role": "${distinct(flatten([for name in local.real_entities : [for role , members in var.bindings : {\"name\": \"${name}\", \"role\": \"${role}\", \"members\": \"${members}\"}]]))}"
}
]
}