generated from telekom-mms/terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables.tf
222 lines (206 loc) · 8.49 KB
/
variables.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
variable "mysql_flexible_server" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "mysql_flexible_server_configuration" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "mysql_flexible_database" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "mysql_flexible_server_firewall_rule" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "postgresql_flexible_server" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "postgresql_flexible_server_configuration" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "postgresql_flexible_server_database" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "postgresql_flexible_server_firewall_rule" {
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 = {
mysql_flexible_server = {
name = ""
administrator_login = null
administrator_password = null
backup_retention_days = null
create_mode = "Default"
delegated_subnet_id = null
geo_redundant_backup_enabled = null
point_in_time_restore_time_in_utc = null
private_dns_zone_id = null
replication_role = null
sku_name = null
source_server_id = null
version = null
zone = null
customer_managed_key = {
key_vault_key_id = null
primary_user_assigned_identity_id = null
geo_backup_key_vault_key_id = null
geo_backup_user_assigned_identity_id = null
}
high_availability = {
standby_availability_zone = null
}
identity = {}
maintenance_window = {
day_of_week = null
start_hour = null
start_minute = null
}
storage = {
auto_grow_enabled = null
io_scaling_enabled = null
iops = null
size_gb = null
}
tags = {}
}
mysql_flexible_server_configuration = {
name = ""
}
mysql_flexible_database = {
name = ""
charset = "utf8mb4"
collation = "utf8mb4_unicode_ci"
}
mysql_flexible_server_firewall_rule = {
name = ""
}
postgresql_flexible_server = {
name = ""
administrator_login = null
administrator_password = null
backup_retention_days = null
create_mode = "Default"
delegated_subnet_id = null
geo_redundant_backup_enabled = null
point_in_time_restore_time_in_utc = null
private_dns_zone_id = null
replication_role = null
sku_name = null
source_server_id = null
auto_grow_enabled = true
storage_mb = null
version = null
zone = null
authentication = {}
customer_managed_key = {}
high_availability = {
standby_availability_zone = null
}
identity = {}
maintenance_window = {}
tags = {}
}
postgresql_flexible_server_configuration = {
name = ""
}
postgresql_flexible_server_database = {
name = ""
charset = "UTF8"
collation = "de-DE"
}
postgresql_flexible_server_firewall_rule = {
name = ""
}
}
/**
compare and merge custom and default values
*/
mysql_flexible_server_values = {
for mysql_flexible_server in keys(var.mysql_flexible_server) :
mysql_flexible_server => merge(local.default.mysql_flexible_server, var.mysql_flexible_server[mysql_flexible_server])
}
/**
compare and merge custom and default values
*/
postgresql_flexible_server_values = {
for postgresql_flexible_server in keys(var.postgresql_flexible_server) :
postgresql_flexible_server => merge(local.default.postgresql_flexible_server, var.postgresql_flexible_server[postgresql_flexible_server])
}
/**
deep merge of all custom and default values
*/
mysql_flexible_server = {
for mysql_flexible_server in keys(var.mysql_flexible_server) :
mysql_flexible_server => merge(
local.mysql_flexible_server_values[mysql_flexible_server],
{
for config in [
"customer_managed_key",
"high_availability",
"identity",
"maintenance_window",
"storage"
] :
config => merge(local.default.mysql_flexible_server[config], local.mysql_flexible_server_values[mysql_flexible_server][config])
}
)
}
mysql_flexible_server_configuration = {
for mysql_flexible_server_configuration in keys(var.mysql_flexible_server_configuration) :
mysql_flexible_server_configuration => merge(local.default.mysql_flexible_server_configuration, var.mysql_flexible_server_configuration[mysql_flexible_server_configuration])
}
mysql_flexible_database = {
for mysql_flexible_database in keys(var.mysql_flexible_database) :
mysql_flexible_database => merge(local.default.mysql_flexible_database, var.mysql_flexible_database[mysql_flexible_database])
}
mysql_flexible_server_firewall_rule = {
for mysql_flexible_server_firewall_rule in keys(var.mysql_flexible_server_firewall_rule) :
mysql_flexible_server_firewall_rule => merge(local.default.mysql_flexible_server_firewall_rule, var.mysql_flexible_server_firewall_rule[mysql_flexible_server_firewall_rule])
}
/**
deep merge of all custom and default values
*/
postgresql_flexible_server = {
for postgresql_flexible_server in keys(var.postgresql_flexible_server) :
postgresql_flexible_server => merge(
local.postgresql_flexible_server_values[postgresql_flexible_server],
{
for config in [
"authentication",
"customer_managed_key",
"high_availability",
"identity",
"maintenance_window",
] :
config => merge(local.default.postgresql_flexible_server[config], local.postgresql_flexible_server_values[postgresql_flexible_server][config])
}
)
}
postgresql_flexible_server_configuration = {
for postgresql_flexible_server_configuration in keys(var.postgresql_flexible_server_configuration) :
postgresql_flexible_server_configuration => merge(local.default.postgresql_flexible_server_configuration, var.postgresql_flexible_server_configuration[postgresql_flexible_server_configuration])
}
postgresql_flexible_server_database = {
for postgresql_flexible_server_database in keys(var.postgresql_flexible_server_database) :
postgresql_flexible_server_database => merge(local.default.postgresql_flexible_server_database, var.postgresql_flexible_server_database[postgresql_flexible_server_database])
}
postgresql_flexible_server_firewall_rule = {
for postgresql_flexible_server_firewall_rule in keys(var.postgresql_flexible_server_firewall_rule) :
postgresql_flexible_server_firewall_rule => merge(local.default.postgresql_flexible_server_firewall_rule, var.postgresql_flexible_server_firewall_rule[postgresql_flexible_server_firewall_rule])
}
}