-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
250 lines (214 loc) · 5.88 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
############################
# General
############################
variable "region" {
default = "eu-central-1"
}
variable "org" {
description = "Organization name - part of other resource names"
type = string
default = "terraform"
}
variable "environment" {
description = "Environment name"
type = string
}
variable "additional_tags" {
description = "Additional tags to include"
type = map(string)
default = {}
}
############################
# Network
############################
variable "vpc_cidr" {
description = "VPC CIDR address"
type = string
default = "10.0.0.0/16"
}
variable "vpc_nat_setting" {
description = "Enable NAT Gateway"
type = object({
enable_nat_gateway : bool
multi_az_nat_gateway : bool
})
default = {
enable_nat_gateway = true
multi_az_nat_gateway = false
}
}
variable "logs_retention_days" {
description = "Log retention in days"
type = number
default = 14
}
variable "enable_bastion" {
description = "True if bastion host should be created"
type = bool
default = false
}
############################
# Kubernetes
############################
variable "eks_cluster_name" {
description = "Name of the Kubernetes cluster"
type = string
default = "eks-cluster"
}
variable "eks_cluster_version" {
description = "Kubernetes cluster version"
type = string
default = "1.26"
}
variable "eks_cluster_log_types" {
description = "A list of the desired control plane logs to enable"
type = list(string)
default = ["api", "audit", "authenticator"]
}
variable "eks_cluster_endpoint_access" {
description = "EKS managed node group default configurations"
type = object({
enable_public_access : bool
enable_private_access : bool
})
default = {
enable_public_access = true
enable_private_access = false
}
}
variable "eks_cluster_node_groups_default_configuration" {
description = "EKS managed node group default configurations"
type = any
default = {
disk_size = 40
instance_types = ["m5.large"]
attach_cluster_primary_security_group = true
min_size = 1
max_size = 5
desired_size = 3
labels = {
"node-group" = "default"
}
}
}
variable "eks_cluster_node_groups" {
description = "EKS managed additional node group"
type = any
default = {}
}
variable "eks_cluster_fargate_profiles" {
description = "EKS Fargate profile object"
type = map(object({}))
default = {}
}
variable "eks_cluster_auth_user" {
description = "AWS users with access permission to EKS cluster"
type = list(object({
userarn : string
username : string
groups = list(string)
}))
default = []
}
variable "eks_cluster_auth_role" {
description = "AWS roles with access permission to EKS cluster"
type = list(object({
rolearn : string
username : string
groups = list(string)
}))
default = []
}
variable "eks_default_cluster_addons" {
description = "Map of default cluster addon configurations to enable for the cluster."
type = any
default = {
coredns = {
resolve_conflicts = "OVERWRITE"
preserve = true
most_recent = true
}
vpc-cni = {
resolve_conflicts = "OVERWRITE"
preserve = true
most_recent = true
}
kube-proxy = {
resolve_conflicts = "OVERWRITE"
preserve = true
most_recent = true
}
}
}
variable "eks_additional_cluster_addons" {
description = "Map of additional cluster addon configurations to enable for the cluster."
type = any
default = {}
}
variable "eks_node_security_group_tags" {
description = "Map of tags for eks node sg"
type = map(string)
default = {}
}
variable "eks_storage_classes" {
description = "EBS storage class with custom parameters"
type = list(object({
name = string
storage_class_provisioner = string
parameters = optional(map(string))
volume_binding_mode = optional(string)
reclaim_policy = optional(string)
}
))
default = []
}
variable "eks_enable_secret_encryption" {
description = "Should KMS key to encrypt kubernetes secrets be generated"
type = bool
default = true
}
variable "eks_single_az" {
description = "Specifies if all node's should be deployed in the same AZ"
type = bool
default = false
}
variable "manage_aws_auth_configmap" {
description = "Should Terraform manage aws_auth ConfigMap used for setting up cluster access"
type = bool
default = true
}
variable "create_aws_auth_configmap" {
description = "Should Terraform create aws_auth ConfigMap used for setting up cluster access"
type = bool
default = false
}
variable "create_vpc" {
description = "Specifies if new VPC be created, if not `vpc_id` and `subnet_ids` variables need to be provided"
type = bool
default = true
}
variable "vpc_id" {
description = "ID of existing VPC, only used when `create_vpc` is set to `false`"
type = string
default = ""
}
variable "private_subnet_ids" {
description = "List of IDs of existing private subnets, only used when `create_vpc` is set to `false`"
type = list(string)
default = []
}
variable "public_subnet_ids" {
description = "List of IDs of existing public subnets, only used when `create_vpc` is set to `false`"
type = list(string)
default = []
}
variable "enable_ebs_csi_driver" {
description = "Specifies if enable the EBS/CSI driver"
type = bool
default = true
}
variable "eks_create" {
description = "Specifies if actually create the EKS cluster"
type = bool
default = true
}