generated from stackxcloud/template-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
185 lines (159 loc) · 5.43 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
variable "name" {
description = "Base Name for all resources (preferably generated by terraform-null-label)"
type = string
default = "stackx-worker"
}
variable "tags" {
description = "User specific Tags to attach to resources (will be merged with module tags)"
type = map(string)
default = {}
}
variable "asg_tags" {
description = "Add additional tags to the EKS Managed Node Group created AutoScalingGroup (in addition to the default cluster-autoscaler capacityType tag)"
type = map(string)
default = {}
}
variable "labels" {
description = "Labels to add to the EKS Worker nodes"
type = map(string)
default = {
"app" = "stackx"
}
}
variable "taints" {
description = "List of taints to add to the EKS Worker nodes (e.g. `{key = \"test\", value = \"example\", effect = \"NoSchedule\"}`)"
type = list(map(string))
default = [{}]
}
variable "arch" {
description = "CPU architecture to use for managed node groups (valid: `x86_64`, `ARM_64`)"
type = string
default = "x86_64"
validation {
condition = contains(["x86_64", "ARM_64"], var.arch)
error_message = "The selected CPU architecture is not valid - please choose one of: `x86_64`, `ARM_64`."
}
}
variable "force_update_version" {
description = "Force update of the version of the Managed Node Group even if PodDisruptionBudgets (PDB) are halting the drain process."
type = bool
default = false
}
variable "aws_key_name" {
description = "Name of an existing AWS Key Pair name for SSH access to EKS Worker nodes - Leave empty to create new Key Pair"
type = string
default = ""
}
variable "key_storage" {
description = "The AWS service to use to storage the generated SSH Public/Private Key pair for Worker node access"
type = string
default = "ssm"
validation {
condition = contains(["ssm", "secretsmanager"], var.key_storage)
error_message = "The selected key storage is not valid - please choose one of: `ssm`, `secretsmanager`."
}
}
variable "ssh_allow_workstation" {
description = "Allow your workstation IPv4 address access via SSH to EKS Worker nodes (`var.ssh_allowed_sg_ids` must be an empty list and `var.vpc_id` must be set"
type = bool
default = true
}
variable "vpc_id" {
description = "VPC ID of EKS to create SecurityGroup for SSH access (optional)"
type = string
default = ""
}
variable "ssh_allowed_sg_ids" {
description = "List of source Security Group IDs to be allowed for SSH acess to EKS Worker nodes"
type = list(string)
default = []
}
variable "list_policies_arns" {
description = "List of additional policy ARNs to attach to EKS Worker Instance Profile role (max. 10)"
type = list(string)
validation {
condition = length(var.list_policies_arns) <= 10
error_message = "Maximum allowed IAM Policy ARNs to attach: 10."
}
default = []
}
variable "instance_types" {
description = "List of EC2 Instance types of AWS EKS - Managed Node Group for stateless applications (e.g. `[t3a.large]`)"
type = list(string)
default = ["c5a.xlarge", "c6a.xlarge"]
}
variable "desired_size" {
description = "Number of desired AWS EKS Worker nodes - Managed Node Group. Will be IGNORED after initial deployment"
type = number
default = 3
}
variable "max_size" {
description = "Maximum of AWS EKS Worker nodes - Managed Node Group Stateless (maximum capacity for ASG, e.g. `8`)"
type = number
default = 3
}
variable "min_size" {
description = "Minimum of AWS EKS Worker nodes - Managed Node Group Stateless (minimum capacity for ASG, e.g. `8`)"
type = number
default = 3
}
variable "disk_size" {
description = "EBS disk size in GiB for AWS EKS Worker nodes."
type = number
default = 80
}
variable "tf_eks_node_group_timeouts" {
description = "(Optional) Updated Terraform resource management timeouts. Applies to `aws_eks_node_group` in particular to permit resource management times"
type = map(string)
default = {
create = "40m"
update = "60m"
delete = "40m"
}
}
variable "cluster_name" {
description = "EKS Cluster name"
type = string
default = "stackx"
}
variable "cluster_version" {
description = "EKS Cluster version"
type = string
default = "1.27"
}
variable "release_version" {
description = "EKS AMI release version (get from AWS SSM, eg. `/aws/service/bottlerocket/aws-k8s-1.27/x86_64/latest/image_version`)"
type = string
default = null
}
variable "gpu_ami" {
description = "Enable / Disable the use of the Bottlerocket AMI for GPU workloads"
type = bool
default = false
}
variable "node_role_arn" {
description = "IAM Role for workers"
type = string
default = null
}
variable "subnet_ids" {
description = "Subnet IDs where to create workers into"
type = list(string)
}
variable "spot" {
description = "Enable / Disable EC2 spot instances (`true` or `false`)"
type = bool
default = false
}
variable "recovery_window_in_days" {
description = "Secrets manager recovery window for SSH Public and Private Key for EKS Worker nodes"
type = number
default = 7
validation {
condition = (
var.recovery_window_in_days >= 7 &&
var.recovery_window_in_days <= 30
)
error_message = "Secrets manager recovery window needs to be between 7 and 30 days."
}
}