forked from comet-ml/terraform-aws-comet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
1086 lines (914 loc) · 31.9 KB
/
variables.tf
File metadata and controls
1086 lines (914 loc) · 31.9 KB
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
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
########################
#### 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
default = false
}
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 = "Creates S3 buckets for MPM Druid/Airflow workloads (used by comet_s3 module)"
type = bool
default = false
}
variable "enable_loki_bucket" {
description = "Enable creation of S3 bucket for Loki logs (used by comet_s3 module)"
type = bool
default = true
}
variable "eks_enable_karpenter" {
description = "Enable Karpenter prerequisites in the EKS module: discovery tags, SQS interruption queue, EventBridge rules, node IAM role/instance profile, and controller IRSA role"
type = bool
default = false
}
variable "enable_cloudwatch_exporter" {
description = "Enable CloudWatch Exporter IRSA role for scraping ElastiCache, RDS, and other AWS managed service metrics (used by comet_eks module)"
type = bool
default = false
}
variable "enable_monitoring_setup" {
description = "Enable monitoring namespace and Grafana credentials secret in EKS (used by comet_eks module)"
type = bool
default = true
}
variable "monitoring_namespace" {
description = "Kubernetes namespace for monitoring resources"
type = string
default = "monitoring"
}
variable "enable_secretsmanager" {
description = "Toggles the comet_secretsmanager module for provisioning Comet Secrets Manager secrets. Requires enable_rds and enable_elasticache to be true."
type = bool
default = true
}
variable "enable_config_secret" {
description = "Enable creation of the config secret (cometml/{environment}/config)"
type = bool
default = true
}
variable "enable_monitoring_secret" {
description = "Enable creation of the monitoring-secrets secret (cometml/{environment}/monitoring-secrets)"
type = bool
default = true
}
variable "enable_clickhouse_secret" {
description = "Enable creation of the clickhouse secret (cometml/{environment}/clickhouse)"
type = bool
default = true
}
################
#### Global ####
################
variable "environment" {
description = "Deployment environment, i.e. dev/stage/prod, etc"
type = string
default = "dev"
}
variable "secretsmanager_environment" {
description = "Environment name used for Secrets Manager secret paths (e.g., cometml/{secretsmanager_environment}/config). Defaults to 'environment' if not set. Useful for multi-region deployments where infrastructure names include region but secrets should be region-agnostic."
type = string
default = null
}
variable "comet_hostname" {
description = "Hostname prefix for the Comet deployment (e.g., 'mercedesamgf1' results in 'mercedesamgf1.comet-hosted.com'). Defaults to 'environment' if not set. Useful for multi-region deployments where infrastructure names include region but hostnames should be region-agnostic."
type = string
default = null
}
variable "rds_environment" {
description = "Override environment name for RDS resource naming. When null, falls back to var.environment. Use this when the environment was shortened but RDS resources were originally created with a longer name."
type = string
default = null
}
variable "rds_cluster_identifier" {
description = "Override for the RDS cluster identifier. When null, uses the default pattern. Use this when the cluster was created with a different naming convention than the current module version."
type = string
default = null
}
variable "rds_instance_identifier_prefix" {
description = "Override prefix for RDS instance identifiers. When null, uses the default pattern. Instance index is appended automatically."
type = string
default = null
}
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_vpc ####
variable "vpc_cidr" {
description = "CIDR block for the VPC to provision"
type = string
default = "10.0.0.0/16"
}
#### 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$|^al2023$|^rhel(7|8|9)$|^ubuntu(18|20|22)$", var.comet_ec2_ami_type))
error_message = "Invalid OS type. Allowed values are 'al2', 'al2023', 'rhel7', 'rhel8', 'rhel9', '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 = "m7i.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 = "gp3"
}
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
}
#### ACM Certificate ####
variable "enable_acm_certificate" {
description = "Enable creation of an ACM certificate for {environment}.comet-hosted.com and *.{environment}.comet-hosted.com"
type = bool
default = false
}
variable "acm_domain_name" {
description = "Base domain name for the ACM certificate. Defaults to '{comet_hostname}.comet-hosted.com'"
type = string
default = null
}
variable "acm_route53_zone_id" {
description = "Route 53 hosted zone ID for DNS validation. Required when enable_acm_certificate is true."
type = string
default = null
}
variable "acm_wait_for_validation" {
description = "Whether to wait for the certificate to be validated before completing"
type = bool
default = true
}
#### comet_ec2_alb ####
variable "ssl_certificate_arn" {
description = "ARN of the ACM certificate to use for the ALB. If enable_acm_certificate is true and this is not set, the created certificate will be used."
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.34"
}
variable "eks_cluster_endpoint_public_access" {
description = "Enable public access to the EKS cluster API endpoint"
type = bool
default = true
}
variable "eks_cluster_endpoint_private_access" {
description = "Enable private access to the EKS cluster API endpoint"
type = bool
default = false
}
variable "eks_cluster_security_group_additional_rules" {
description = "Additional security group rules for the EKS cluster security group (e.g., for VPN access)"
type = any
default = {}
}
variable "eks_private_access_cidrs" {
description = "List of CIDR blocks that can access the EKS API via private endpoint (e.g., VPN subnets). Only applied when private endpoint access is enabled."
type = list(string)
default = []
}
variable "eks_authentication_mode" {
description = "Authentication mode for the EKS cluster. Valid values: CONFIG_MAP, API, API_AND_CONFIG_MAP"
type = string
default = "API_AND_CONFIG_MAP"
validation {
condition = contains(["CONFIG_MAP", "API", "API_AND_CONFIG_MAP"], var.eks_authentication_mode)
error_message = "Authentication mode must be CONFIG_MAP, API, API_AND_CONFIG_MAP."
}
}
variable "eks_enable_cluster_creator_admin_permissions" {
description = "Grant the cluster creator admin permissions via EKS access entry"
type = bool
default = true
}
variable "eks_admin_role_arns" {
description = "List of IAM role ARNs to grant AmazonEKSClusterAdminPolicy via EKS Access Entries"
type = list(string)
default = []
}
variable "eks_kms_key_administrators" {
description = "List of IAM ARNs (users/roles) that should have administrator access to the EKS KMS key. These principals can manage the key (update, delete, etc.)."
type = list(string)
default = []
}
variable "eks_kms_key_users" {
description = "List of IAM ARNs (users/roles) that should have usage access to the EKS KMS key. These principals can use the key for encryption/decryption operations."
type = list(string)
default = []
}
variable "eks_mng_ami_type" {
description = "AMI family to use for the EKS nodes (default for all nodegroups). Ignored if eks_mng_ami_id is set."
type = string
default = "AL2023_x86_64_STANDARD"
}
variable "eks_admin_ami_type" {
description = "AMI type override for admin nodegroup. Null uses the default (eks_mng_ami_type)."
type = string
default = null
}
variable "eks_comet_ami_type" {
description = "AMI type override for comet nodegroup. Set to AL2023_ARM_64_STANDARD for Graviton."
type = string
default = null
}
variable "eks_clickhouse_ami_type" {
description = "AMI type override for ClickHouse nodegroup. Null uses the default (eks_mng_ami_type)."
type = string
default = null
}
variable "eks_mng_ami_id" {
description = "Specific AMI ID to use for all EKS node groups (e.g., ami-0123456789abcdef0). If set, overrides eks_mng_ami_type."
type = string
default = null
}
# Node Group Toggles
variable "eks_enable_admin_node_group" {
description = "Enable admin node group for EKS cluster management tasks"
type = bool
default = true
}
variable "eks_enable_comet_node_group" {
description = "Enable comet node group for main Comet application workloads"
type = bool
default = true
}
variable "eks_enable_druid_node_group" {
description = "Enable druid node group for Apache Druid workloads (requires enable_mpm_infra to be true)"
type = bool
default = true
}
variable "eks_enable_airflow_node_group" {
description = "Enable airflow node group for Apache Airflow workloads (requires enable_mpm_infra to be true)"
type = bool
default = true
}
variable "eks_enable_clickhouse_node_group" {
description = "Enable dedicated ClickHouse node group"
type = bool
default = true
}
# Admin Node Group Variables
variable "eks_admin_name" {
description = "Name for the admin node group"
type = string
default = "admin"
}
variable "eks_admin_instance_types" {
description = "Instance types for admin node group"
type = list(string)
default = ["t3.large"]
}
variable "eks_admin_min_size" {
description = "Minimum number of nodes in admin node group"
type = number
default = 1
}
variable "eks_admin_max_size" {
description = "Maximum number of nodes in admin node group"
type = number
default = 3
}
variable "eks_admin_desired_size" {
description = "Desired number of nodes in admin node group"
type = number
default = 2
}
# Comet Node Group Variables
variable "eks_comet_name" {
description = "Name for the comet node group"
type = string
default = "comet"
}
variable "eks_comet_instance_types" {
description = "Instance types for comet node group"
type = list(string)
default = ["m7i.4xlarge"]
}
variable "eks_comet_min_size" {
description = "Minimum number of nodes in comet node group"
type = number
default = 2
}
variable "eks_comet_max_size" {
description = "Maximum number of nodes in comet node group"
type = number
default = 10
}
variable "eks_comet_desired_size" {
description = "Desired number of nodes in comet node group"
type = number
default = 3
}
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 = false
}
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_enable_metrics_server" {
description = "Enables the metrics-server EKS managed addon (required for HPA and `kubectl top`). Also opens node SG port 10251 so the kube-apiserver can reach the metrics-server pod."
type = bool
default = true
}
variable "eks_metrics_server_addon_version" {
description = "Pinned version of the metrics-server EKS managed addon. Set to null to use the AWS default for the cluster's Kubernetes version."
type = string
default = null
}
variable "eks_enable_cluster_autoscaler" {
description = "Enables the Cluster Autoscaler IRSA role and ASG auto-discovery tags. The cluster-autoscaler Helm release itself is deployed out-of-band (ArgoCD AppSet). Toggling this creates the IAM role and tags the EKS-managed ASGs so the autoscaler can discover and scale them."
type = bool
default = false
}
# Druid Node Group Variables
variable "eks_druid_name" {
description = "Name for the druid node group"
type = string
default = "druid"
}
variable "eks_druid_instance_types" {
description = "Instance types for druid node group"
type = list(string)
default = ["m7i.2xlarge"]
}
variable "eks_druid_min_size" {
description = "Minimum number of nodes in druid node group"
type = number
default = 2
}
variable "eks_druid_max_size" {
description = "Maximum number of nodes in druid node group"
type = number
default = 8
}
variable "eks_druid_desired_size" {
description = "Desired number of nodes in druid node group"
type = number
default = 4
}
# Airflow Node Group Variables
variable "eks_airflow_name" {
description = "Name for the airflow node group"
type = string
default = "airflow"
}
variable "eks_airflow_instance_types" {
description = "Instance types for airflow node group"
type = list(string)
default = ["t3.medium"]
}
variable "eks_airflow_min_size" {
description = "Minimum number of nodes in airflow node group"
type = number
default = 1
}
variable "eks_airflow_max_size" {
description = "Maximum number of nodes in airflow node group"
type = number
default = 4
}
variable "eks_airflow_desired_size" {
description = "Desired number of nodes in airflow node group"
type = number
default = 2
}
# ClickHouse Node Group Variables
variable "eks_clickhouse_name" {
description = "Name for the ClickHouse node group"
type = string
default = "clickhouse"
}
variable "eks_clickhouse_instance_types" {
description = "Instance types for the ClickHouse node group"
type = list(string)
default = ["m7i.2xlarge"]
}
variable "eks_clickhouse_min_size" {
description = "Minimum number of ClickHouse nodes"
type = number
default = 2
}
variable "eks_clickhouse_max_size" {
description = "Maximum number of ClickHouse nodes"
type = number
default = 3
}
variable "eks_clickhouse_desired_size" {
description = "Desired number of ClickHouse nodes"
type = number
default = 2
}
variable "eks_clickhouse_volume_size" {
description = "EBS volume size in GB for ClickHouse nodes"
type = number
default = 500
}
variable "eks_clickhouse_volume_type" {
description = "EBS volume type for ClickHouse nodes"
type = string
default = "gp3"
}
variable "eks_clickhouse_volume_encrypted" {
description = "Enable EBS encryption for ClickHouse volumes"
type = bool
default = true
}
variable "eks_clickhouse_delete_on_termination" {
description = "Delete EBS volumes on instance termination"
type = bool
default = true
}
variable "eks_clickhouse_taints" {
description = "Taints to apply to ClickHouse node group"
type = list(object({
key = string
value = string
effect = string
}))
default = [
{
key = "clickhouse"
value = "true"
effect = "NO_SCHEDULE"
}
]
}
# Karpenter Node Group Variables
# Used only when eks_enable_karpenter = true. See modules/comet_eks/variables.tf for details.
variable "eks_karpenter_node_instance_types" {
description = "Instance types for the Karpenter controller node group"
type = list(string)
default = ["t3.medium", "t3a.medium"]
}
variable "eks_karpenter_node_min_size" {
description = "Minimum number of nodes in the Karpenter controller node group"
type = number
default = 1
}
variable "eks_karpenter_node_max_size" {
description = "Maximum number of nodes in the Karpenter controller node group"
type = number
default = 2
}
variable "eks_karpenter_node_desired_size" {
description = "Desired number of nodes in the Karpenter controller node group"
type = number
default = 1
}
variable "eks_karpenter_node_disk_size" {
description = "EBS root volume size in GB for Karpenter controller nodes"
type = number
default = 50
}
variable "eks_admin_karpenter_instance_types" {
description = "Instance types for the admin node group when Karpenter is enabled. These nodes run system workloads only (cert-manager, LBC, etc.) so smaller instances are appropriate."
type = list(string)
default = ["t3.medium", "t3a.medium"]
}
variable "eks_karpenter_chart_version" {
description = "Version of the comet-stsaas-karpenter Helm chart to install from helm.comet.com"
type = string
default = "0.1.0"
}
variable "eks_karpenter_helm_username" {
description = "Username for the helm.comet.com Helm repository"
type = string
sensitive = true
default = ""
}
variable "eks_karpenter_helm_password" {
description = "Password for the helm.comet.com Helm repository"
type = string
sensitive = true
default = ""
}
variable "eks_karpenter_extra_tags" {
description = "Extra EC2 instance tags applied to all Karpenter-provisioned nodes (e.g. Environment)"
type = map(string)
default = {}
}
variable "eks_additional_node_groups" {
description = "Additional EKS managed node groups to create beyond the predefined ones (admin, comet, druid, airflow, clickhouse)"
type = any
default = {}
}
variable "eks_additional_s3_bucket_arns" {
description = "Additional S3 bucket ARNs to grant access to from EKS node groups (for buckets created outside this module)"
type = list(string)
default = []
}
variable "eks_enable_external_secrets" {
description = "Enable External Secrets IRSA role and Helm chart for accessing AWS Secrets Manager from EKS"
type = bool
default = true
}
variable "eks_external_secrets_chart_version" {
description = "Helm chart version for external-secrets"
type = string
default = "2.2.0"
}
variable "eks_storage_class_reclaim_policy" {
description = "Reclaim policy for the gp3 and comet-generic StorageClasses. Use 'Retain' to preserve volumes after PVC deletion (recommended for production), or 'Delete' to automatically delete volumes. Note: StorageClass reclaimPolicy is immutable; existing deployments require StorageClass deletion and recreation."
type = string
default = "Retain"
validation {
condition = contains(["Retain", "Delete"], var.eks_storage_class_reclaim_policy)
error_message = "Must be 'Retain' or 'Delete'."
}
}
#### 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"
}
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.redis7"
}
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 = true
}
variable "elasticache_auth_token" {
description = "Auth token for ElastiCache"
type = string
default = null
}
variable "elasticache_automatic_failover_enabled" {
description = "Enable automatic failover for the ElastiCache replication group. Requires at least one replica (elasticache_num_cache_nodes >= 2)."
type = bool
default = false
}
variable "elasticache_multi_az_enabled" {
description = "Enable Multi-AZ for the ElastiCache replication group. Requires automatic_failover to also be enabled and at least one replica in a different AZ."
type = bool
default = false
}
#### 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 snapshot retention period"
type = number
default = 14
}
variable "rds_preferred_backup_window" {
description = "Backup window for RDS (UTC)"
type = string
default = "02:00-04:00"
}
variable "rds_deletion_protection" {
description = "Enable deletion protection for RDS cluster"
type = bool
default = true
}
variable "rds_storage_type" {
description = "Aurora storage type. Use 'aurora-iopt1' for I/O-Optimized (eliminates I/O charges, 30% instance surcharge). Default null uses Aurora Standard."
type = string
default = null
}
variable "rds_database_name" {
description = "Name for the application database in RDS"
type = string
default = "logger"
}
variable "rds_master_username" {
description = "Master username for RDS database"
type = string
default = "admin"
}
variable "rds_master_password" {
description = "Master password for RDS database. If not provided, a random password will be generated and stored in Secrets Manager."
type = string
default = null
sensitive = true
}
variable "rds_snapshot_identifier" {
description = "Snapshot identifier to restore the RDS cluster from. If provided, the cluster will be restored from this snapshot instead of being created fresh."
type = string
default = null
}
variable "rds_kms_key_id" {
description = "ARN of the KMS key to use for encryption. Required when restoring from a KMS-encrypted shared snapshot. If not specified, the default RDS KMS key will be used."
type = string
default = null
}
variable "rds_performance_insights_enabled" {
description = "Enable Performance Insights for RDS instances"
type = bool
default = true
}
variable "rds_performance_insights_retention_period" {
description = "Retention period for Performance Insights data in days. Valid values are 7, 31, 62, 93, 124, 155, 186, 217, 248, 279, 310, 341, 372, 403, 434, 465, 496, 527, 558, 589, 620, 651, 682, 713, or 731."
type = number
default = 7
}
variable "rds_performance_insights_kms_key_id" {
description = "ARN of KMS key to encrypt Performance Insights data. If not specified, the default RDS KMS key will be used."
type = string
default = null
}
variable "rds_enhanced_monitoring_interval" {
description = "Interval in seconds for Enhanced Monitoring metrics collection. Valid values are 0, 1, 5, 10, 15, 30, 60. Set to 0 to disable Enhanced Monitoring."
type = number
default = 60
}
#### 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
}
variable "common_tags" {
description = "A map of tags to apply to resources"
type = map(string)
}
variable "environment_tag" {
description = "Deployment identifier"
type = string
default = ""
}
#### comet_secretsmanager ####
variable "sendgrid_api_key" {
description = "Base64 encoded SendGrid API key (required when enable_secretsmanager is true)"
type = string
default = ""
sensitive = true
}
variable "secret_seed" {
description = "Secret seed value for Comet. If not provided, a random value will be generated."
type = string
default = null
sensitive = true
}
variable "s3_key" {
description = "S3 key configuration for Secrets Manager"
type = string
default = "IAM-ROLE"
}
variable "s3_secret" {
description = "S3 secret configuration for Secrets Manager"
type = string
default = "IAM-ROLE"
sensitive = true
}
variable "s3_private_key" {
description = "S3 private key configuration for Secrets Manager"
type = string
default = "IAM-ROLE"
}
variable "s3_private_secret" {
description = "S3 private secret configuration for Secrets Manager"
type = string
default = "IAM-ROLE"
sensitive = true
}
variable "s3_public_key" {
description = "S3 public key configuration for Secrets Manager"
type = string
default = "IAM-ROLE"
}