-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
350 lines (328 loc) · 8.13 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
variable "name" {
description = "Name to give to the vm."
type = string
default = "etcd"
}
variable "vcpus" {
description = "Number of vcpus to assign to the vm"
type = number
default = 2
}
variable "memory" {
description = "Amount of memory in MiB"
type = number
default = 8192
}
variable "volume_id" {
description = "Id of the disk volume to attach to the vm"
type = string
}
variable "data_volume_id" {
description = "Id for an optional separate disk volume to attach to the vm on etcd's data path"
type = string
default = ""
}
variable "libvirt_networks" {
description = "Parameters of libvirt network connections if a libvirt networks are used."
type = list(object({
network_name = optional(string, "")
network_id = optional(string, "")
prefix_length = string
ip = string
mac = string
gateway = optional(string, "")
dns_servers = optional(list(string), [])
}))
default = []
}
variable "macvtap_interfaces" {
description = "List of macvtap interfaces."
type = list(object({
interface = string
prefix_length = string
ip = string
mac = string
gateway = optional(string, "")
dns_servers = optional(list(string), [])
}))
default = []
}
variable "cloud_init_volume_pool" {
description = "Name of the volume pool that will contain the cloud init volume"
type = string
}
variable "cloud_init_volume_name" {
description = "Name of the cloud init volume"
type = string
default = ""
}
variable "ssh_admin_user" {
description = "Pre-existing ssh admin user of the image"
type = string
default = "ubuntu"
}
variable "admin_user_password" {
description = "Optional password for admin user"
type = string
sensitive = true
default = ""
}
variable "ssh_admin_public_key" {
description = "Public ssh part of the ssh key the admin will be able to login as"
type = string
}
variable "etcd" {
description = "Etcd parameters"
type = object({
auto_compaction_mode = optional(string, "revision"),
auto_compaction_retention = optional(string, "1000"),
space_quota = optional(number, 8*1024*1024*1024),
grpc_gateway_enabled = optional(bool, false),
client_cert_auth = optional(bool, true)
})
default = {
auto_compaction_mode = "revision"
auto_compaction_retention = "1000"
space_quota = 8*1024*1024*1024
grpc_gateway_enabled = false
client_cert_auth = true
}
}
variable "restore" {
description = "Parameters to restore from an S3 backup when the vm is first created"
type = object({
enabled = bool,
s3 = object({
endpoint = string,
bucket = string,
object_prefix = string,
region = string,
access_key = string,
secret_key = string,
ca_cert = optional(string, "")
}),
encryption_key = optional(string, "")
backup_timestamp = optional(string, "")
})
default = {
enabled = false
s3 = {
endpoint = ""
bucket = ""
object_prefix = ""
region = ""
access_key = ""
secret_key = ""
ca_cert = ""
}
encryption_key = ""
backup_timestamp = ""
}
}
variable "authentication_bootstrap" {
description = "Authentication settings for the node bootstrapping it. Note that root_password is only used if etcd.client_cert_auth setting is set to false"
type = object({
bootstrap = bool,
root_password = string,
})
default = {
bootstrap = false
root_password = ""
}
}
variable "cluster" {
description = "Etcd cluster parameters"
type = object({
is_initializing = optional(bool, false),
initial_token = string,
initial_members = list(object({
ip = string,
name = string,
})),
})
}
variable "tls" {
description = "Etcd tls parameters"
type = object({
ca_cert = string
server_cert = string
server_key = string
})
}
variable "chrony" {
description = "Chrony configuration for ntp. If enabled, chrony is installed and configured, else the default image ntp settings are kept"
type = object({
enabled = bool,
//https://chrony.tuxfamily.org/doc/4.2/chrony.conf.html#server
servers = list(object({
url = string,
options = list(string)
})),
//https://chrony.tuxfamily.org/doc/4.2/chrony.conf.html#pool
pools = list(object({
url = string,
options = list(string)
})),
//https://chrony.tuxfamily.org/doc/4.2/chrony.conf.html#makestep
makestep = object({
threshold = number
limit = number
})
})
default = {
enabled = false
servers = []
pools = []
makestep = {
threshold = 0
limit = 0
}
}
}
variable "fluentbit" {
description = "Fluent-bit configuration"
sensitive = true
type = object({
enabled = bool
etcd_tag = string
node_exporter_tag = string
metrics = optional(object({
enabled = bool
port = number
}), {
enabled = false
port = 0
})
forward = object({
domain = string
port = number
hostname = string
shared_key = string
ca_cert = string
})
})
default = {
enabled = false
etcd_tag = ""
node_exporter_tag = ""
metrics = {
enabled = false
port = 0
}
forward = {
domain = ""
port = 0
hostname = ""
shared_key = ""
ca_cert = ""
}
}
}
variable "vault_agent" {
type = object({
enabled = bool
auth_method = object({
config = object({
role_id = string
secret_id = string
})
})
vault_address = string
vault_ca_cert = string
})
default = {
enabled = false
auth_method = {
config = {
role_id = ""
secret_id = ""
}
}
vault_address = ""
vault_ca_cert = ""
}
}
variable "fluentbit_dynamic_config" {
description = "Parameters for fluent-bit dynamic config if it is enabled"
type = object({
enabled = bool
source = string
etcd = optional(object({
key_prefix = string
endpoints = list(string)
ca_certificate = string
client = object({
certificate = string
key = string
username = string
password = string
})
vault_agent_secret_path = optional(string, "")
}), {
key_prefix = ""
endpoints = []
ca_certificate = ""
client = {
certificate = ""
key = ""
username = ""
password = ""
}
vault_agent_secret_path = ""
})
git = optional(object({
repo = string
ref = string
path = string
trusted_gpg_keys = list(string)
auth = object({
client_ssh_key = string
server_ssh_fingerprint = string
})
}), {
repo = ""
ref = ""
path = ""
trusted_gpg_keys = []
auth = {
client_ssh_key = ""
server_ssh_fingerprint = ""
}
})
})
default = {
enabled = false
source = "etcd"
etcd = {
key_prefix = ""
endpoints = []
ca_certificate = ""
client = {
certificate = ""
key = ""
username = ""
password = ""
}
vault_agent_secret_path = ""
}
git = {
repo = ""
ref = ""
path = ""
trusted_gpg_keys = []
auth = {
client_ssh_key = ""
server_ssh_fingerprint = ""
}
}
}
validation {
condition = contains(["etcd", "git"], var.fluentbit_dynamic_config.source)
error_message = "fluentbit_dynamic_config.source must be 'etcd' or 'git'."
}
}
variable "install_dependencies" {
description = "Whether to install all dependencies in cloud-init"
type = bool
default = true
}