-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
377 lines (316 loc) · 9.11 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
########################
#### Module toggles ####
########################
variable "enable_vpc" {
description = "Toggles the comet_vpc module, to provision a new VPC for hosting the Comet resources"
type = bool
}
variable "enable_ec2" {
description = "Toggles the comet_ec2 module, to provision EC2 resources for running Comet"
type = bool
}
variable "enable_ec2_alb" {
description = "Toggles the comet_ec2_alb module, to provision an ALB in front of the EC2 instance"
type = bool
}
variable "enable_eks" {
description = "Toggles the comet_eks module, to provision EKS resources for running Comet"
type = bool
}
variable "enable_elasticache" {
description = "Toggles the comet_elasticache module for provisioning Comet Redis on elasticache"
type = bool
}
variable "enable_rds" {
description = "Toggles the comet_rds module for provisioning Comet RDS database"
type = bool
}
variable "enable_s3" {
description = "Toggles the comet_s3 module for provisioning Comet S3 bucket"
type = bool
}
variable "enable_mpm_infra" {
description = "Sets MNGs to be created for MPM compute"
type = bool
}
################
#### Global ####
################
variable "environment" {
description = "Deployment environment, i.e. dev/stage/prod, etc"
type = string
default = "dev"
}
variable "region" {
description = "AWS region to provision resources in"
type = string
}
variable "availability_zones" {
description = "List of availability zones from region"
type = list(string)
default = null
}
variable "comet_vpc_id" {
description = "ID of an existing VPC to provision resources in"
type = string
default = null
}
variable "comet_private_subnets" {
description = "List of private subnets IDs from existing VPC to provision resources in"
type = list(string)
default = null
}
variable "comet_public_subnets" {
description = "List of public subnets IDs from existing VPC to provision resources in"
type = list(string)
default = null
}
#######################
#### Module inputs ####
#######################
#### comet_ec2 ####
variable "comet_ec2_ami_type" {
type = string
description = "Operating system type for the EC2 instance AMI"
default = "ubuntu22"
validation {
condition = can(regex("^al2$|^rhel(7|8|9)$|^ubuntu(18|20|22)$", var.comet_ec2_ami_type))
error_message = "Invalid OS type. Allowed values are 'al2', 'rhel7', 'rhel8', 'rhel9', 'ubuntu18', 'ubuntu20', 'ubuntu22'."
}
}
variable "comet_ec2_ami_id" {
description = "AMI ID for the EC2 instance"
type = string
default = ""
}
variable "comet_ec2_instance_type" {
description = "Instance type for the EC2 instance"
type = string
default = "m5.4xlarge"
}
variable "comet_ec2_instance_count" {
description = "Number of EC2 instances to provision"
type = number
default = 1
}
variable "comet_ec2_volume_type" {
description = "EBS volume type for the EC2 instance root volume"
type = string
default = "gp2"
}
variable "comet_ec2_volume_size" {
description = "Size, in gibibytes (GiB), for the EC2 instance root volume"
type = number
default = 1024
}
variable "comet_ec2_key" {
description = "Name of the SSH key to configure on the EC2 instance"
type = string
default = null
}
#### comet_ec2_alb ####
variable "ssl_certificate_arn" {
description = "ARN of the ACM certificate to use for the ALB"
type = string
default = null
}
#### comet_eks ####
variable "eks_cluster_name" {
description = "Name for EKS cluster"
type = string
default = "comet-eks"
}
variable "eks_cluster_version" {
description = "Kubernetes version of the EKS cluster"
type = string
default = "1.27"
}
variable "eks_mng_name" {
description = "Name for the EKS managed nodegroup"
type = string
default = "mng"
}
variable "eks_mng_ami_type" {
description = "AMI family to use for the EKS nodes"
type = string
default = "AL2_x86_64"
}
variable "eks_node_types" {
description = "Node instance types for EKS managed node group"
type = list(string)
default = ["m6i.4xlarge"]
}
variable "eks_mng_desired_size" {
description = "Desired number of nodes in EKS cluster"
type = number
default = 3
}
variable "eks_mng_max_size" {
description = "Maximum number of nodes in EKS cluster"
type = number
default = 6
}
variable "eks_mng_disk_size" {
description = "Size of the storage disks for nodes in EKS cluster"
type = number
default = 500
}
variable "eks_aws_load_balancer_controller" {
description = "Enables the AWS Load Balancer Controller in the EKS cluster"
type = bool
default = true
}
variable "eks_cert_manager" {
description = "Enables cert-manager in the EKS cluster"
type = bool
default = false
}
variable "eks_aws_cloudwatch_metrics" {
description = "Enables AWS Cloudwatch Metrics in the EKS cluster"
type = bool
default = true
}
variable "eks_external_dns" {
description = "Enables ExternalDNS in the EKS cluster"
type = bool
default = false
}
variable "eks_external_dns_r53_zones" {
description = "Route 53 zones for external-dns to have access to"
type = list(string)
default = [
"arn:aws:route53:::hostedzone/XYZ"
]
}
variable "eks_druid_instance_type" {
description = "Instance type for EKS Druid nodes"
type = string
default = "m7i.2xlarge"
}
variable "eks_druid_node_count" {
description = "Instance count for EKS Druid nodes"
type = number
default = 4
}
variable "eks_airflow_instance_type" {
description = "Instance type for EKS Airflow nodes"
type = string
default = "t3.medium"
}
variable "eks_airflow_node_count" {
description = "Instance count for EKS Airflow nodes"
type = number
default = 2
}
#### comet_elasticache ####
variable "elasticache_allow_from_sg" {
description = "Security group from which to allow connections to ElastiCache, to use when provisioning with existing compute"
type = string
default = null
}
variable "elasticache_engine" {
description = "Engine type for ElastiCache cluster"
type = string
default = "redis"
}
variable "elasticache_engine_version" {
description = "Version number for ElastiCache engine"
type = string
default = "7.1.0"
}
variable "elasticache_instance_type" {
description = "ElastiCache instance type"
type = string
default = "cache.r4.xlarge"
}
variable "elasticache_param_group_name" {
description = "Name for the ElastiCache cluster parameter group"
type = string
default = "default.redis5.0"
}
variable "elasticache_num_cache_nodes" {
description = "Number of nodes in the ElastiCache cluster"
type = number
default = 1
}
variable "elasticache_transit_encryption" {
description = "Enable transit encryption for ElastiCache"
type = bool
default = false
}
variable "elasticache_auth_token" {
description = "Auth token for ElastiCache"
type = string
default = null
}
#### comet_rds ####
variable "rds_allow_from_sg" {
description = "Security group from which to allow connections to RDS, to use when provisioning with existing compute"
type = string
default = null
}
variable "rds_engine" {
description = "Engine type for RDS database"
type = string
default = "aurora-mysql"
}
variable "rds_engine_version" {
description = "Engine version number for RDS database"
type = string
default = "8.0"
}
variable "rds_instance_type" {
description = "Instance type for RDS database"
type = string
default = "db.r5.xlarge"
}
variable "rds_instance_count" {
description = "Number of RDS instances in the database cluster"
type = number
default = 2
}
variable "rds_storage_encrypted" {
description = "Enables encryption for RDS storage"
type = bool
default = true
}
variable "rds_iam_db_auth" {
description = "Enables IAM auth for the database in RDS"
type = bool
default = true
}
variable "rds_backup_retention_period" {
description = "Days specified for RDS snapshotretention period"
type = number
default = 7
}
variable "rds_preferred_backup_window" {
description = "Backup window for RDS"
type = string
default = "07:00-09:00"
}
variable "rds_database_name" {
description = "Name for the application database in RDS"
type = string
default = "logger"
}
variable "rds_root_password" {
description = "Root password for RDS database"
type = string
}
#### comet_s3 ####
variable "s3_bucket_name" {
description = "Name for S3 bucket"
type = string
}
variable "s3_force_destroy" {
description = "Option to enable force delete of S3 bucket"
type = bool
default = false
}
#### comet_vpc ####
variable "single_nat_gateway" {
description = "Controls whether single NAT gateway used for all public subnets"
type = bool
default = true
}