This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
forked from dgozalo/terraform-eks-jx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
595 lines (503 loc) · 16.7 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
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
// ----------------------------------------------------------------------------
// Required Variables
// ----------------------------------------------------------------------------
variable "region" {
description = "The region to create the resources into"
type = string
default = "us-east-1"
}
variable "cluster_name" {
description = "Variable to provide your desired name for the cluster. The script will create a random name if this is empty"
type = string
default = ""
}
variable "cluster_version" {
description = "Kubernetes version to use for the EKS cluster."
type = string
}
// ----------------------------------------------------------------------------
// Vault
// ----------------------------------------------------------------------------
variable "vault_user" {
description = "The AWS IAM Username whose credentials will be used to authenticate the Vault pods against AWS"
type = string
default = ""
}
variable "vault_url" {
description = "URL to an external Vault instance in case Jenkins X does not create its own system Vault"
type = string
default = ""
}
// ----------------------------------------------------------------------------
// Velero/backup
// ----------------------------------------------------------------------------
variable "enable_backup" {
description = "Whether or not Velero backups should be enabled"
type = bool
default = false
}
variable "velero_namespace" {
description = "Kubernetes namespace for Velero"
type = string
default = "velero"
}
variable "velero_schedule" {
description = "The Velero backup schedule in cron notation to be set in the Velero Schedule CRD (see [default-backup.yaml](https://github.com/jenkins-x/jenkins-x-boot-config/blob/master/systems/velero-backups/templates/default-backup.yaml))"
type = string
default = "0 * * * *"
}
variable "velero_ttl" {
description = "The the lifetime of a velero backup to be set in the Velero Schedule CRD (see [default-backup.yaml](https://github.com/jenkins-x/jenkins-x-boot-config/blob/master/systems/velero-backups/templates/default-backup))"
type = string
default = "720h0m0s"
}
variable "velero_username" {
description = "The username to be assigned to the Velero IAM user"
type = string
default = "velero"
}
// ----------------------------------------------------------------------------
// Worker Nodes Variables
// ----------------------------------------------------------------------------
variable "desired_node_count" {
description = "The number of worker nodes to use for the cluster"
type = number
default = 3
}
variable "min_node_count" {
description = "The minimum number of worker nodes to use for the cluster"
type = number
default = 3
}
variable "max_node_count" {
description = "The maximum number of worker nodes to use for the cluster"
type = number
default = 5
}
variable "node_machine_type" {
description = "The instance type to use for the cluster's worker nodes"
type = string
default = "m5.large"
}
variable "spot_price" {
description = "The spot price ceiling for spot instances"
type = string
default = "0.1"
}
variable "node_group_ami" {
description = "ami type for the node group worker intances"
type = string
default = "AL2_x86_64"
}
variable "node_group_disk_size" {
description = "node group worker disk size"
type = string
default = "50"
}
variable "node_groups_managed" {
description = "List of managed node groups to be created and their respective settings"
type = any
default = { eks-jx-node-group = {} }
}
variable "key_name" {
description = "The ssh key pair name"
type = string
default = ""
}
variable "volume_type" {
description = "The volume type to use. Can be standard, gp2 or io1"
type = string
default = "gp2"
}
variable "volume_size" {
description = "The volume size in GB"
type = number
default = 50
}
variable "iops" {
description = "The IOPS value"
type = number
default = 0
}
// ----------------------------------------------------------------------------
// VPC Variables
// ----------------------------------------------------------------------------
variable "vpc_name" {
description = "The name of the VPC to be created for the cluster"
type = string
default = "tf-vpc-eks"
}
variable "public_subnets" {
description = "The public subnet CIDR block to use in the created VPC"
type = list(string)
default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
}
variable "private_subnets" {
description = "The private subnet CIDR block to use in the created VPC"
type = list(string)
default = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
}
variable "vpc_cidr_block" {
description = "The vpc CIDR block"
type = string
default = "10.0.0.0/16"
}
variable "enable_nat_gateway" {
description = "Should be true if you want to provision NAT Gateways for each of your private networks"
type = bool
default = false
}
variable "single_nat_gateway" {
description = "Should be true if you want to provision a single shared NAT Gateway across all of your private networks"
type = bool
default = false
}
// ----------------------------------------------------------------------------
// External DNS Variables
// ----------------------------------------------------------------------------
variable "apex_domain" {
description = "The main domain to either use directly or to configure a subdomain from"
type = string
default = ""
}
variable "subdomain" {
description = "The subdomain to be added to the apex domain. If subdomain is set, it will be appended to the apex domain in `jx-requirements-eks.yml` file"
type = string
default = ""
}
variable "tls_email" {
description = "The email to register the LetsEncrypt certificate with. Added to the `jx-requirements.yml` file"
type = string
default = ""
}
// ----------------------------------------------------------------------------
// Flag Variables
// ----------------------------------------------------------------------------
variable "enable_logs_storage" {
description = "Flag to enable or disable long term storage for logs"
type = bool
default = true
}
variable "enable_reports_storage" {
description = "Flag to enable or disable long term storage for reports"
type = bool
default = true
}
variable "enable_repository_storage" {
description = "Flag to enable or disable the repository bucket storage"
type = bool
default = true
}
variable "enable_external_dns" {
description = "Flag to enable or disable External DNS in the final `jx-requirements.yml` file"
type = bool
default = false
}
variable "create_and_configure_subdomain" {
description = "Flag to create an NS record set for the subdomain in the apex domain's Hosted Zone"
type = bool
default = false
}
variable "force_destroy_subdomain" {
description = "Flag to determine whether subdomain zone get forcefully destroyed. If set to false, empty the sub domain first in the aws Route 53 console, else terraform destroy will fail with HostedZoneNotEmpty error"
type = bool
default = false
}
variable "enable_tls" {
description = "Flag to enable TLS in the final `jx-requirements.yml` file"
type = bool
default = false
}
variable "production_letsencrypt" {
description = "Flag to use the production environment of letsencrypt in the `jx-requirements.yml` file"
type = bool
default = false
}
variable "force_destroy" {
description = "Flag to determine whether storage buckets get forcefully destroyed. If set to false, empty the bucket first in the aws s3 console, else terraform destroy will fail with BucketNotEmpty error"
type = bool
default = false
}
variable "enable_spot_instances" {
description = "Flag to enable spot instances"
type = bool
default = false
}
variable "enable_worker_group" {
description = "Flag to enable worker group. Setting this to false will provision a node group instead"
type = bool
default = true
}
variable "enable_key_rotation" {
description = "Flag to enable kms key rotation"
type = bool
default = true
}
variable "cluster_in_private_subnet" {
description = "Flag to enable installation of cluster on private subnets"
type = bool
default = false
}
variable "use_kms_s3" {
description = "Flag to determine whether kms should be used for encrypting s3 buckets"
type = bool
default = false
}
// ----------------------------------------------------------------------------
// Cluster AWS Auth Variables
// ----------------------------------------------------------------------------
variable "map_accounts" {
description = "Additional AWS account numbers to add to the aws-auth configmap."
type = list(string)
default = []
}
variable "map_roles" {
description = "Additional IAM roles to add to the aws-auth configmap."
type = list(object({
rolearn = string
username = string
groups = list(string)
}))
default = []
}
variable "map_users" {
description = "Additional IAM users to add to the aws-auth configmap."
type = list(object({
userarn = string
username = string
groups = list(string)
}))
default = []
}
variable "enable_key_name" {
description = "Flag to enable ssh key pair name"
type = bool
default = false
}
variable "s3_kms_arn" {
description = "ARN of the kms key used for encrypting s3 buckets"
type = string
default = ""
}
variable "is_jx2" {
default = true
type = bool
description = "Flag to specify if jx2 related resources need to be created"
}
variable "ignoreLoadBalancer" {
default = false
type = bool
description = "Flag to specify if jx boot will ignore loadbalancer DNS to resolve to an IP"
}
variable "cluster_endpoint_private_access" {
description = "Indicates whether or not the Amazon EKS private API server endpoint is enabled."
type = bool
default = false
}
variable "cluster_endpoint_private_access_cidrs" {
description = "List of CIDR blocks which can access the Amazon EKS private API server endpoint, when public access is disabled."
type = list(string)
default = ["0.0.0.0/0"]
}
variable "cluster_endpoint_public_access" {
description = "Indicates whether or not the Amazon EKS public API server endpoint is enabled."
type = bool
default = true
}
variable "cluster_endpoint_public_access_cidrs" {
description = "List of CIDR blocks which can access the Amazon EKS public API server endpoint."
type = list(string)
default = ["0.0.0.0/0"]
}
variable "allowed_spot_instance_types" {
description = "Allowed machine types for spot instances (must be same size)"
type = any
default = []
}
variable "enable_worker_groups_launch_template" {
description = "Flag to enable Worker Group Launch Templates"
type = bool
default = false
}
variable "lt_desired_nodes_per_subnet" {
description = "The number of worker nodes in each Subnet (AZ) if using Launch Templates"
type = number
default = 1
}
variable "lt_min_nodes_per_subnet" {
description = "The minimum number of worker nodes in each Subnet (AZ) if using Launch Templates"
type = number
default = 1
}
variable "lt_max_nodes_per_subnet" {
description = "The maximum number of worker nodes in each Subnet (AZ) if using Launch Templates"
type = number
default = 2
}
variable "registry" {
description = "Registry used to store images"
type = string
default = ""
}
variable "jx_git_url" {
description = "URL for the Jenkins X cluster git repository"
type = string
default = ""
}
variable "jx_bot_username" {
description = "Bot username used to interact with the Jenkins X cluster git repository"
type = string
default = ""
}
variable "jx_bot_token" {
description = "Bot token used to interact with the Jenkins X cluster git repository"
type = string
default = ""
}
variable "create_eks" {
description = "Controls if EKS cluster and associated resources should be created or not. If you have an existing eks cluster for jx, set it to false"
type = bool
default = true
}
variable "create_vpc" {
description = "Controls if VPC and related resources should be created. If you have an existing vpc for jx, set it to false"
type = bool
default = true
}
variable "vpc_id" {
description = "The VPC to create EKS cluster in if create_vpc is false"
type = string
default = ""
}
variable "subnets" {
description = "The subnet ids to create EKS cluster in if create_vpc is false"
type = list(string)
default = []
}
variable "use_vault" {
description = "Flag to control vault resource creation"
type = bool
default = true
}
variable "use_asm" {
description = "Flag to specify if AWS Secrets manager is being used"
type = bool
default = false
}
variable "install_kuberhealthy" {
description = "Flag to specify if kuberhealthy operator should be installed"
type = bool
default = true
}
variable "encrypt_volume_self" {
description = "Encrypt the ebs and root volume for the self managed worker nodes. This is only valid for the worker group launch template"
type = bool
default = false
}
variable "cluster_encryption_config" {
description = "Configuration block with encryption configuration for the cluster."
type = list(object({
provider_key_arn = string
resources = list(string)
}))
default = []
}
variable "create_tekton_role" {
description = "Flag to control tekton iam role creation"
type = bool
default = true
}
variable "create_exdns_role" {
description = "Flag to control external dns iam role creation"
type = bool
default = true
}
variable "create_cm_role" {
description = "Flag to control cert manager iam role creation"
type = bool
default = true
}
variable "create_cmcainjector_role" {
description = "Flag to control cert manager ca-injector iam role creation"
type = bool
default = true
}
variable "create_ctrlb_role" {
description = "Flag to control controller build iam role creation"
type = bool
default = true
}
variable "create_autoscaler_role" {
description = "Flag to control cluster autoscaler iam role creation"
type = bool
default = true
}
variable "create_ssm_role" {
description = "Flag to control AWS Parameter Store iam roles creation"
type = bool
default = false
}
variable "create_asm_role" {
description = "Flag to control AWS Secrets Manager iam roles creation"
type = bool
default = false
}
variable "create_velero_role" {
description = "Flag to control velero iam role creation"
type = bool
default = true
}
variable "manage_apex_domain" {
description = "Flag to control if apex domain should be managed/updated by this module. Set this to false,if your apex domain is managed in a different AWS account or different provider"
default = true
type = bool
}
variable "manage_subdomain" {
description = "Flag to control subdomain creation/management"
default = true
type = bool
}
variable "create_pipeline_vis_role" {
description = "Flag to control pipeline visualizer role"
type = bool
default = true
}
variable "create_bucketrepo_role" {
description = "Flag to control bucketrepo role"
type = bool
default = true
}
variable "additional_tekton_role_policy_arns" {
description = "Additional Policy ARNs to attach to Tekton IRSA Role"
type = list(string)
default = []
}
variable "create_nginx" {
default = false
type = bool
description = "Decides whether we want to create nginx resources using terraform or not"
}
variable "nginx_release_name" {
default = "nginx-ingress"
type = string
description = "Name of the nginx release name"
}
variable "nginx_namespace" {
default = "nginx"
type = string
description = "Name of the nginx namespace"
}
variable "nginx_chart_version" {
type = string
description = "nginx chart version"
}
variable "create_nginx_namespace" {
default = true
type = bool
description = "Boolean to control nginx namespace creation"
}
variable "nginx_values_file" {
default = "nginx_values.yaml"
type = string
description = "Name of the values file which holds the helm chart values"
}