forked from aws-ia/terraform-aws-eks-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
382 lines (327 loc) · 11.2 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
variable "tags" {
description = "Additional tags (e.g. `map('BusinessUnit`,`XYZ`)"
type = map(string)
default = {}
}
#-------------------------------
# VPC Config for EKS Cluster
#-------------------------------
variable "vpc_id" {
description = "VPC Id"
type = string
}
variable "private_subnet_ids" {
description = "List of private subnets Ids for the cluster and worker nodes"
type = list(string)
default = []
}
variable "public_subnet_ids" {
description = "List of public subnets Ids for the worker nodes"
type = list(string)
default = []
}
variable "control_plane_subnet_ids" {
description = "A list of subnet IDs where the EKS cluster control plane (ENIs) will be provisioned. Used for expanding the pool of subnets used by nodes/node groups without replacing the EKS control plane"
type = list(string)
default = []
}
#-------------------------------
# EKS module variables (terraform-aws-modules/eks/aws)
#-------------------------------
variable "create_eks" {
description = "Create EKS cluster"
type = bool
default = true
}
variable "cluster_timeouts" {
description = "Create, update, and delete timeout configurations for the cluster"
type = map(string)
default = {}
}
variable "cluster_name" {
description = "EKS Cluster Name"
type = string
default = ""
}
variable "cluster_version" {
description = "Kubernetes `<major>.<minor>` version to use for the EKS cluster (i.e.: `1.22`)"
type = string
default = "1.22"
}
#-------------------------------
# EKS Cluster Security Groups
#-------------------------------
variable "create_cluster_security_group" {
description = "Toggle to create or assign cluster security group"
type = bool
default = true
}
variable "cluster_security_group_id" {
description = "Security group to be used if creation of cluster security group is turned off"
type = string
default = ""
}
variable "cluster_additional_security_group_ids" {
description = "List of additional, externally created security group IDs to attach to the cluster control plane"
type = list(string)
default = []
}
variable "cluster_security_group_additional_rules" {
description = "List of additional security group rules to add to the cluster security group created. Set `source_node_security_group = true` inside rules to set the `node_security_group` as source"
type = any
default = {}
}
variable "cluster_security_group_tags" {
description = "A map of additional tags to add to the cluster security group created"
type = map(string)
default = {}
}
#-------------------------------
# EKS Cluster VPC Config
#-------------------------------
variable "cluster_endpoint_public_access" {
description = "Indicates whether or not the EKS public API server endpoint is enabled. Default to EKS resource and it is true"
type = bool
default = true
}
variable "cluster_endpoint_private_access" {
description = "Indicates whether or not the EKS private API server endpoint is enabled. Default to EKS resource and it is false"
type = bool
default = false
}
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"]
}
#-------------------------------
# EKS Cluster ENCRYPTION
#-------------------------------
variable "cluster_kms_key_arn" {
description = "A valid EKS Cluster KMS Key ARN to encrypt Kubernetes secrets"
type = string
default = null
}
variable "cluster_kms_key_deletion_window_in_days" {
description = "The waiting period, specified in number of days (7 - 30). After the waiting period ends, AWS KMS deletes the KMS key"
type = number
default = 30
}
variable "cluster_kms_key_additional_admin_arns" {
description = "A list of additional IAM ARNs that should have FULL access (kms:*) in the KMS key policy"
type = list(string)
default = []
}
variable "cluster_encryption_config" {
description = "Configuration block with encryption configuration for the cluster"
type = list(object({
provider_key_arn = string
resources = list(string)
}))
default = []
}
#-------------------------------
# EKS Cluster Kubernetes Network Config
#-------------------------------
variable "cluster_ip_family" {
description = "The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`. You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created"
type = string
default = "ipv4"
}
variable "cluster_service_ipv4_cidr" {
description = "The CIDR block to assign Kubernetes service IP addresses from. If you don't specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks"
type = string
default = null
}
variable "cluster_service_ipv6_cidr" {
description = "The IPV6 Service CIDR block to assign Kubernetes service IP addresses"
type = string
default = null
}
#-------------------------------
# EKS Cluster CloudWatch Logging
#-------------------------------
variable "create_cloudwatch_log_group" {
description = "Determines whether a log group is created by this module for the cluster logs. If not, AWS will automatically create one if logging is enabled"
type = bool
default = false
}
variable "cluster_enabled_log_types" {
description = "A list of the desired control plane logging to enable"
type = list(string)
default = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
}
variable "cloudwatch_log_group_retention_in_days" {
description = "Number of days to retain log events. Default retention - 90 days"
type = number
default = 90
}
variable "cloudwatch_log_group_kms_key_id" {
description = "If a KMS Key ARN is set, this key will be used to encrypt the corresponding log group. Please be sure that the KMS Key has an appropriate key policy (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)"
type = string
default = null
}
#-------------------------------
# EKS Cluster IAM role
#-------------------------------
variable "create_iam_role" {
description = "Determines whether a an IAM role is created or to use an existing IAM role"
type = bool
default = true
}
variable "iam_role_arn" {
description = "Existing IAM role ARN for the cluster. Required if `create_iam_role` is set to `false`"
type = string
default = null
}
variable "iam_role_name" {
description = "Name to use on IAM role created"
type = string
default = null
}
variable "iam_role_path" {
description = "Cluster IAM role path"
type = string
default = null
}
variable "iam_role_permissions_boundary" {
description = "ARN of the policy that is used to set the permissions boundary for the IAM role"
type = string
default = null
}
variable "iam_role_additional_policies" {
description = "Additional policies to be added to the IAM role"
type = list(string)
default = []
}
variable "enable_irsa" {
description = "Determines whether to create an OpenID Connect Provider for EKS to enable IRSA"
type = bool
default = true
}
variable "openid_connect_audiences" {
description = "List of OpenID Connect audience client IDs to add to the IRSA provider"
type = list(string)
default = []
}
variable "custom_oidc_thumbprints" {
description = "Additional list of server certificate thumbprints for the OpenID Connect (OIDC) identity provider's server certificate(s)"
type = list(string)
default = []
}
variable "cluster_identity_providers" {
description = "Map of cluster identity provider configurations to enable for the cluster. Note - this is different/separate from IRSA"
type = any
default = {}
}
#-------------------------------
# Node Groups
#-------------------------------
variable "managed_node_groups" {
description = "Managed node groups configuration"
type = any
default = {}
}
variable "self_managed_node_groups" {
description = "Self-managed node groups configuration"
type = any
default = {}
}
variable "enable_windows_support" {
description = "Enable Windows support"
type = bool
default = false
}
#-------------------------------
# Worker Additional Variables
#-------------------------------
variable "create_node_security_group" {
description = "Determines whether to create a security group for the node groups or use the existing `node_security_group_id`"
type = bool
default = true
}
variable "node_security_group_additional_rules" {
description = "List of additional security group rules to add to the node security group created. Set `source_cluster_security_group = true` inside rules to set the `cluster_security_group` as source"
type = any
default = {}
}
variable "node_security_group_tags" {
description = "A map of additional tags to add to the node security group created"
type = map(string)
default = {}
}
variable "worker_additional_security_group_ids" {
description = "A list of additional security group ids to attach to worker instances"
type = list(string)
default = []
}
#-------------------------------
# Fargate
#-------------------------------
variable "fargate_profiles" {
description = "Fargate profile configuration"
type = any
default = {}
}
#-------------------------------
# aws-auth Config Map
#-------------------------------
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 "aws_auth_additional_labels" {
description = "Additional kubernetes labels applied on aws-auth ConfigMap"
type = map(string)
default = {}
}
variable "eks_readiness_timeout" {
description = "The maximum time (in seconds) to wait for EKS API server endpoint to become healthy"
type = number
default = "600"
}
#-------------------------------
# Amazon EMR on EKS
#-------------------------------
variable "enable_emr_on_eks" {
description = "Enable EMR on EKS"
type = bool
default = false
}
variable "emr_on_eks_teams" {
description = "EMR on EKS Teams config"
type = any
default = {}
}
#-------------------------------
# TEAMS (Soft Multi-tenancy)
#-------------------------------
variable "application_teams" {
description = "Map of maps of Application Teams to create"
type = any
default = {}
}
variable "platform_teams" {
description = "Map of maps of platform teams to create"
type = any
default = {}
}