-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
358 lines (303 loc) · 11.3 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
/**
* Copyright 2020 Quortex
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "cluster_name" {
type = string
description = "A name to be used as the AWS resource name for the cluster"
default = "quortex"
}
variable "master_role_name" {
type = string
description = "A name to be used as the AWS resource name for the master role"
default = "quortex-master"
}
variable "worker_role_name" {
type = string
description = "A name to be used as the AWS resource name for the IAM role used by EKS managed worker nodes"
default = "quortex-worker-managed"
}
variable "autoscaler_role_name" {
type = string
description = "A name to be used as the AWS resource name for the autoscaler role"
default = "quortex-autoscaler"
}
variable "autoscaler_sa" {
description = "Service Account name for Autoscaler"
type = object({
namespace = string
name = string
})
default = {
namespace = "kube-system"
name = "cluster-autoscaler-sa"
}
}
variable "ebs_csi_driver_role_name" {
type = string
description = "A name to be used as the AWS resource name for the Amazon EBS CSI Driver role."
default = "quortex-ebs-csi-driver"
}
variable "ebs_csi_driver_sa" {
description = "Service Account name for EBS CSI Driver"
type = object({
namespace = string
name = string
})
default = {
namespace = "kube-system"
name = "ebs-csi-controller-sa"
}
}
variable "aws_vpc_cni_role_name" {
type = string
description = "A name to be used as the AWS resource name for the Amazon VPC CNI role."
default = "quortex-vpc-cni"
}
variable "aws_vpc_cni_sa" {
description = "Service Account name for Amazon VPC CNI"
type = object({
namespace = string
name = string
})
default = {
namespace = "kube-system"
name = "aws-node"
}
}
variable "aws_load_balancer_controller_role_name" {
type = string
description = "A name to be used as the AWS resource name for the aws-load-balancer-controller role."
default = "quortex-aws-load-balancer-controller"
}
variable "aws_load_balancer_controller_sa" {
description = "Service Account name for aws-load-balancer-controller"
type = object({
namespace = string
name = string
})
default = {
namespace = "kube-system"
name = "aws-load-balancer-controller"
}
}
variable "external_dns_role_name" {
type = string
description = "A name to be used as the AWS resource name for the external-dns role."
default = "quortex-external-dns"
}
variable "external_dns_sa" {
description = "Service Account name for external-dns"
type = object({
namespace = string
name = string
})
default = {
namespace = "kube-system"
name = "external-dns"
}
}
variable "kubernetes_version" {
type = string
description = "Kubernetes master version."
default = "1.22"
}
variable "kubernetes_worker_nodes_version" {
type = string
description = "Kubernetes version for worker nodes. An empty string means the same Kubernetes version as the master's"
default = ""
}
locals {
kubernetes_worker_nodes_version = var.kubernetes_worker_nodes_version == "" ? var.kubernetes_version : var.kubernetes_worker_nodes_version
}
variable "kubernetes_cluster_image_id" {
type = string
description = "ID of the AMI to use for worker nodes (applies only to advanced_node_groups). If not defined, the latest AMI whose name matches \"amazon-eks-node-<kubernetes_worker_nodes_version>-v*\" will be used"
default = null
}
variable "vpc_id" {
type = string
description = "ID of the VPC this cluster should be attached to."
}
variable "master_subnet_ids" {
type = list(string)
description = "The IDs of the subnets where master should be placed"
default = []
}
variable "master_authorized_networks" {
type = map(string)
description = "External networks that can access the Kubernetes cluster master through HTTPS. This is a dictionary where the value is the CIDR block of the authorized range."
default = {}
}
variable "pods_subnets" {
type = map(object({ id = string, availability_zone = string, cidr = string, public = bool }))
description = <<EOT
A map representing the pods subnets. Each item contains the subnet's ID,
Availability Zone, cidr block, and whether the subnet is public or not.
EOT
default = {}
}
variable "handle_eni_configs" {
type = bool
description = "To determine if eniconfig resources should be managed by this module"
default = false
}
variable "tags" {
type = map(any)
description = "The EKS resource tags (a map of key/value pairs) to be applied to the cluster."
default = {}
}
variable "compute_tags" {
type = map(any)
description = "The EKS resource tags (a map of key/value pairs) to be applied to the cluster's compute resources only."
default = {}
}
variable "node_groups" {
type = map(any)
description = "EKS-managed node groups. The nodes are attached automatically to the cluster via EKS. Defined as a map where the key defines the node group name, and the value is a map defining instance_types, scaling_desired_size, scaling_min_size, scaling_max_size, disk_size, cluster_autoscaler_enabled"
}
variable "node_groups_advanced" {
type = map(any)
description = "[EXPERIMENTAL] Node groups that are not managed via EKS. The nodes are attached to the cluster with userdata passed to the instance boot script. More options are available than with EKS-managed node groups (taints, spot instances...). Defined as a map where the key defines the node group name, and the value is a map containing the node group parameters."
}
variable "node_use_max_pods" {
type = bool
default = true
description = "Set to false to prevent EKS from setting --max-pods in Kubelet config. By default, EKS sets the maximum number of pods that can run on the node, based on the instance type. Disabling this can be useful when using a CNI other than the default, like Calico."
}
variable "node_use_max_pods_allowed" {
type = bool
default = false
description = "Set to use max number of pods allowed to run in node instead of recommended value"
}
variable "instance_profile_name" {
type = string
description = "A name for the instance profile resource in AWS. Used only when node_groups_advanced is used."
default = "quortex"
}
variable "remote_access_ssh_key" {
type = string
description = "Configure SSH access to the nodes. Specify a key pair name that exists in AWS EC2."
default = null
}
variable "remote_access_allowed_ip_ranges" {
type = list(string)
description = "List of IP CIDR blocks allowed to access the nodes via SSH"
default = []
}
variable "handle_iam_resources" {
type = bool
description = "Wether to handle IAM resource lifecycle (master role / worker role / IAM instance profile for worker nodes...)"
default = true
}
variable "handle_iam_ebs_csi_driver" {
type = bool
description = "Wether to handle IAM resources lifecycle for Amazon EBS CSI Driver"
default = true
}
variable "handle_iam_aws_vpc_cni" {
type = bool
description = "Wether to handle IAM resources lifecycle for Amazon VPC CNI"
default = true
}
variable "handle_iam_aws_load_balancer_controller" {
type = bool
description = "Whether to handle IAM resources lifecycle for aws-load-balancer-controller addon"
default = false
}
variable "handle_iam_cluster_autoscaler" {
type = bool
description = "Wether to handle IAM resources lifecycle for cluster-autoscaler"
default = true
}
variable "handle_iam_external_dns" {
type = bool
description = "Whether to handle IAM resources lifecycle for external-dns addon"
default = false
}
variable "master_role_arn" {
type = string
description = "The ARN of a role with the necessary permissions for EKS master. (to be used with handle_iam_resources = false)"
default = ""
}
variable "worker_role_arn" {
type = string
description = "The ARN of a role with the necessary permissions for EKS workers. (to be used with handle_iam_resources = false)"
default = ""
}
variable "enabled_cluster_log_types" {
type = list(string)
description = "List of the desired control plane logging to enable. For more information, see Amazon EKS Control Plane Logging (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html)."
default = []
}
variable "cluster_logs_retention" {
type = number
description = "Specifies the number of days you want to retain log events for the cluster logs log group."
default = 7
}
variable "cluster_addons" {
description = "Map of cluster addon configurations to enable for the cluster.`"
type = any
default = {}
}
variable "vpc_cni_addon" {
description = "vpc-cni addon definition"
type = object({
version = string
resolve_conflicts = optional(string, "OVERWRITE")
preserve = optional(bool)
configuration_values = any
})
nullable = true
}
variable "manage_aws_auth_configmap" {
description = "Determines whether to manage the aws-auth configmap."
type = bool
default = false
}
variable "create_aws_auth_configmap" {
description = "Determines whether to create the aws-auth configmap. NOTE - this is only intended for scenarios where the configmap does not exist (i.e. - when using only self-managed node groups)."
type = bool
default = false
}
variable "aws_auth_roles" {
description = "List of role maps to add to the aws-auth configmap. For more information, see https://github.com/kubernetes-sigs/aws-iam-authenticator#full-configuration-format."
type = list(any)
default = []
}
variable "aws_auth_users" {
description = "List of user maps to add to the aws-auth configmap. For more information, see https://github.com/kubernetes-sigs/aws-iam-authenticator#full-configuration-format."
type = list(any)
default = []
}
variable "aws_auth_accounts" {
description = "List of account maps to add to the aws-auth configmap. For more information, see https://github.com/kubernetes-sigs/aws-iam-authenticator#full-configuration-format."
type = list(any)
default = []
}
variable "cluster_security_group_additional_rules" {
description = "Additional rules for cluster security group."
type = map(object({
description = optional(string)
protocol = string
type = string
from_port = number
to_port = number
cidr_blocks = optional(list(string))
ipv6_cidr_blocks = optional(list(string))
prefix_list_ids = optional(list(string))
source_security_group_id = optional(string)
}))
default = {}
}