-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvars.tf
381 lines (326 loc) · 13.7 KB
/
vars.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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
#### [General] Required Variables #################################################################
variable "aws_region" {
description = "region this stack should be applied to"
}
variable "alb_ingress_https_listener_arn" {
description = "The arn of the https alb listener for ingress data."
}
variable "vpc_id" {
description = "Id of the vpc where to place in the instances."
}
variable "alb_subnet_ids" {
description = "Ids of the subnets to deploy the alb's into."
type = "list"
}
#### [Nomad] Required Variables ###################################################################
variable "nomad_ami_id_servers" {
description = "The ID of the AMI to be used for the nomad server nodes."
}
variable "nomad_ami_id_clients" {
description = "The ID of the AMI to be used for the nomad clientnodes."
}
variable "nomad_clients_public_services_subnet_ids" {
description = "Ids of the subnets to deploy the nomad client nodes providing the data-center public-services into."
type = "list"
}
variable "nomad_clients_private_services_subnet_ids" {
description = "Ids of the subnets to deploy the nomad client nodes providing the data-center private-services into."
type = "list"
}
variable "nomad_clients_content_connector_subnet_ids" {
description = "Ids of the subnets to deploy the nomad client nodes providing the data-center content-connector into."
type = "list"
}
variable "nomad_clients_backoffice_subnet_ids" {
description = "Ids of the subnets to deploy the nomad client nodes providing the data-center backoffice into."
type = "list"
}
variable "nomad_server_subnet_ids" {
description = "Ids of the subnets to deploy the nomad servers into."
type = "list"
}
#### [Consul] Required Variables ##################################################################
variable "consul_ami_id" {
description = "The ID of the AMI to be used for the consul nodes."
}
variable "consul_server_subnet_ids" {
description = "Ids of the subnets to deploy the consul servers into."
type = "list"
}
#### [General] Optional Variables ##################################################################
variable "ssh_key_name" {
description = "The name of an EC2 Key Pair that can be used to SSH to the EC2 Instances in this cluster. Set to an empty string to not associate a Key Pair."
default = ""
}
variable "env_name" {
description = "Name of the environment (i.e. prod)."
default = "playground"
}
variable "unique_postfix" {
description = "A postfix to be used to generate unique resource names per deployment."
default = ""
}
variable "instance_type_server" {
description = "The instance type for all nomad and consul server nodes."
default = "t3.medium"
}
variable "stack_name" {
description = "Shortcut for this stack."
default = "COS"
}
variable "allowed_ssh_cidr_blocks" {
description = "A list of cidr block from which inbound ssh traffic should be allowed."
type = "list"
default = []
}
variable "allowed_cidr_blocks_for_ui_alb" {
description = "Map for cidr blocks that should get access over alb. The format is name:cidr-block. I.e. 'my_cidr'='90.250.75.79/32'"
type = "map"
default = {
"all" = "0.0.0.0/0"
}
}
variable "ui_alb_https_listener_cert_arn" {
description = "ARN of the certificate that should be used to set up the https endpoint for the ui-alb's. If not provided, a http enpoint will be created."
default = ""
}
variable "ui_alb_use_https_listener" {
description = "If true, the https endpoint for the ui-albs will be created instead of the http one. Precondition for this is that ui_alb_https_listener_cert_arn is set apropriately."
default = false
}
variable "alb_backoffice_https_listener_arn" {
description = "The arn of the https alb listener for the backoffice data-center. To attach the alb listener to the backoffice data-center the variable attach_backoffice_alb_listener has to be set to true as well."
default = ""
}
variable "attach_backoffice_alb_listener" {
description = "Set this to true in case an alb shall be attached to the backoffice data-center. In this case the variable alb_backoffice_https_listener_arn has to be set specifying the correct alb listener."
default = false
}
#### [Nomad] Optional Variables ###################################################################
variable "nomad_server_scaling_cfg" {
description = "Scaling configuration for the nomad servers."
type = "map"
default = {
"min" = 3
"max" = 3
"desired_capacity" = 3
}
}
variable "nomad_private_services_dc_node_cfg" {
description = "Node configuration for the nomad nodes of the private-services data center."
type = "map"
default = {
"min" = 1
"max" = 1
"desired_capacity" = 1
"instance_type" = "t3.medium"
}
}
# Example for a ebs_block_device created from a snapshot and one with a certain size.
# ebs_block_devices = [{
# "device_name" = "/dev/xvdf"
# "snapshot_id" = "snap-XYZ"
# },
# {
# "device_name" = "/dev/xvde"
# "volume_size" = "50"
# }]
variable "ebs_block_devices_private_services_dc" {
description = "List of ebs volume definitions for those ebs_volumes that should be added to the instances created with the EC2 launch-configurationd. Each element in the list is a map containing keys defined for ebs_block_device (see: https://www.terraform.io/docs/providers/aws/r/launch_configuration.html#ebs_block_device."
type = "list"
default = []
}
# Space list of device to mount target entries for the private_services dc
# A device to mount target entry is a key value pair (separated by ' ').
# key ... is the name of the device (i.e. /dev/xvdf)
# value ... is the name of the mount target (i.e. /mnt/map1)
# Example: ["/dev/xvde:/mnt/map1","/dev/xvdf:/mnt/map2"]
variable "device_to_mount_target_map_private_services_dc" {
description = "List of device to mount target entries."
type = "list"
default = []
}
# List of tags to add to the private_services datacenter instances
# A tag is a map consiting of key (string), value (string) and propagate (bool) at launch
# key ... the key for the tag (i.e. version)
# value ... the value (i.e. v1.2.9)
# Example:
# additional_instance_tags_private_services_dc = [ {
# "key" = "version"
# "value" = "v1.2.9"
# "propagate_at_launch" = "true"
# }]
variable "additional_instance_tags_private_services_dc" {
description = "List of tags to add to the private_services datacenter instances. The entries of the list are maps consiting of key, value and propagate at launch."
type = "list"
default = []
}
variable "nomad_public_services_dc_node_cfg" {
description = "Node configuration for the nomad nodes of the public-services data center."
type = "map"
default = {
"min" = 1
"max" = 1
"desired_capacity" = 1
"instance_type" = "t3.medium"
}
}
# Example for a ebs_block_device created from a snapshot and one with a certain size.
# ebs_block_devices = [{
# "device_name" = "/dev/xvdf"
# "snapshot_id" = "snap-XYZ"
# },
# {
# "device_name" = "/dev/xvde"
# "volume_size" = "50"
# }]
variable "ebs_block_devices_public_services_dc" {
description = "List of ebs volume definitions for those ebs_volumes that should be added to the instances of the public-services dc. Each element in the list is a map containing keys defined for ebs_block_device (see: https://www.terraform.io/docs/providers/aws/r/launch_configuration.html#ebs_block_device."
type = "list"
default = []
}
# Space list of device to mount target entries for the public_services dc
# A device to mount target entry is a key value pair (separated by ' ').
# key ... is the name of the device (i.e. /dev/xvdf)
# value ... is the name of the mount target (i.e. /mnt/map1)
# Example: ["/dev/xvde:/mnt/map1","/dev/xvdf:/mnt/map2"]
variable "device_to_mount_target_map_public_services_dc" {
description = "List of device to mount target entries."
type = "list"
default = []
}
# List of tags to add to the public_services datacenter instances
# A tag is a map consiting of key (string), value (string) and propagate (bool) at launch
# key ... the key for the tag (i.e. version)
# value ... the value (i.e. v1.2.9)
# Example:
# additional_instance_tags_public_services_dc = [ {
# "key" = "version"
# "value" = "v1.2.9"
# "propagate_at_launch" = "true"
# }]
variable "additional_instance_tags_public_services_dc" {
description = "List of tags to add to the public_services datacenter instances. The entries of the list are maps consiting of key, value and propagate at launch."
type = "list"
default = []
}
variable "nomad_backoffice_dc_node_cfg" {
description = "Node configuration for the nomad nodes of the backoffice data center."
type = "map"
default = {
"min" = 1
"max" = 1
"desired_capacity" = 1
"instance_type" = "t3.medium"
}
}
# Example for a ebs_block_device created from a snapshot and one with a certain size.
# ebs_block_devices = [{
# "device_name" = "/dev/xvdf"
# "snapshot_id" = "snap-XYZ"
# },
# {
# "device_name" = "/dev/xvde"
# "volume_size" = "50"
# }]
variable "ebs_block_devices_backoffice_dc" {
description = "List of ebs volume definitions for those ebs_volumes that should be added to the instances of the backoffice dc. Each element in the list is a map containing keys defined for ebs_block_device (see: https://www.terraform.io/docs/providers/aws/r/launch_configuration.html#ebs_block_device."
type = "list"
default = []
}
# Space list of device to mount target entries for the backoffice dc
# A device to mount target entry is a key value pair (separated by ' ').
# key ... is the name of the device (i.e. /dev/xvdf)
# value ... is the name of the mount target (i.e. /mnt/map1)
# Example: ["/dev/xvde:/mnt/map1","/dev/xvdf:/mnt/map2"]
variable "device_to_mount_target_map_backoffice_dc" {
description = "List of device to mount target entries."
type = "list"
default = []
}
# List of tags to add to the backoffice datacenter instances
# A tag is a map consiting of key (string), value (string) and propagate (bool) at launch
# key ... the key for the tag (i.e. version)
# value ... the value (i.e. v1.2.9)
# Example:
# additional_instance_tags_backoffice_dc = [ {
# "key" = "version"
# "value" = "v1.2.9"
# "propagate_at_launch" = "true"
# }]
variable "additional_instance_tags_backoffice_dc" {
description = "List of tags to add to the backoffice datacenter instances. The entries of the list are maps consiting of key, value and propagate at launch."
type = "list"
default = []
}
variable "nomad_content_connector_dc_node_cfg" {
description = "Node configuration for the nomad nodes of the content-connetor data center."
type = "map"
default = {
"min" = 1
"max" = 1
"desired_capacity" = 1
"instance_type" = "t3.medium"
}
}
# Example for a ebs_block_device created from a snapshot and one with a certain size.
# ebs_block_devices = [{
# "device_name" = "/dev/xvdf"
# "snapshot_id" = "snap-XYZ"
# },
# {
# "device_name" = "/dev/xvde"
# "volume_size" = "50"
# }]
variable "ebs_block_devices_content_connector_dc" {
description = "List of ebs volume definitions for those ebs_volumes that should be added to the instances of the content-connector dc. Each element in the list is a map containing keys defined for ebs_block_device (see: https://www.terraform.io/docs/providers/aws/r/launch_configuration.html#ebs_block_device."
type = "list"
default = []
}
# Space list of device to mount target entries for the content-connector dc
# A device to mount target entry is a key value pair (separated by ' ').
# key ... is the name of the device (i.e. /dev/xvdf)
# value ... is the name of the mount target (i.e. /mnt/map1)
# Example: ["/dev/xvde:/mnt/map1","/dev/xvdf:/mnt/map2"]
variable "device_to_mount_target_map_content_connector_dc" {
description = "List of device to mount target entries."
type = "list"
default = []
}
# List of tags to add to the content_connector datacenter instances
# A tag is a map consiting of key (string), value (string) and propagate (bool) at launch
# key ... the key for the tag (i.e. version)
# value ... the value (i.e. v1.2.9)
# Example:
# additional_instance_tags_content_connector_dc = [ {
# "key" = "version"
# "value" = "v1.2.9"
# "propagate_at_launch" = "true"
# }]
variable "additional_instance_tags_content_connector_dc" {
description = "List of tags to add to the content_connector datacenter instances. The entries of the list are maps consiting of key, value and propagate at launch."
type = "list"
default = []
}
variable "efs_dns_name" {
description = "DNS name of the efs this nodes should have access to."
default = ""
}
variable "map_bucket_name" {
description = "name of the s3 bucket carrying the maps."
default = ""
}
#### [Consul] Optional Variables ##################################################################
variable "consul_num_servers" {
description = "The number of Consul server nodes to deploy. We strongly recommend using 3 or 5."
default = 3
}
variable "consul_instance_type" {
description = "The instance type for all consul server nodes."
default = "t3.medium"
}
variable "ecr_repositories" {
description = "List of names for the ECR repositories to be created. Nomad will use them to get docker images from it in the job files."
type = "list"
default = []
}