-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
346 lines (293 loc) · 10.6 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
variable "adcs" {
description = "ADCS variables required when using ADCS Issuer with Cert Manager"
type = object({
url = string
username = string
ca_bundle = string
certificate_template_name = string
})
default = null
}
variable "adcs_password" {
description = "ADCS password required when using ADCS Issuer with Cert Manager"
type = string
sensitive = true
default = ""
}
variable "aks_agents_size" {
description = "The default size of the agents pool."
type = string
default = "Standard_D2s_v3"
}
variable "aks_api_server_authorized_ip_ranges" {
description = "The list of authorized IP ranges to contact the API server."
type = list(string)
default = ["0.0.0.0/0"]
}
variable "aks_enable_host_encryption" {
description = "Whether to enable host encryption."
type = bool
default = false
}
variable "aks_maintenance_window" {
type = object({
allowed = list(object({
day = string
hours = set(number)
})),
not_allowed = list(object({
end = string
start = string
})),
})
description = "Maintenance configuration of the managed cluster."
default = {
allowed = [
{
day = "Sunday",
hours = [22, 23]
},
],
not_allowed = []
}
}
variable "aks_rbac_aad_admin_group_object_ids" {
description = "List of object IDs of the Azure AD groups that will be set as cluster admin."
type = list(string)
default = []
}
variable "aks_sku_tier" {
description = "The SKU tier for this Kubernetes Cluster."
type = string
default = "Standard"
}
variable "aks_vnet_subnet_id" {
description = "The ID of the subnet in which to deploy the Kubernetes Cluster."
type = string
}
variable "cert_manager_keyvault_name" {
description = "Keyvault name to use for cert-manager. Required if cluster issuer is keyvault"
type = string
default = null
}
variable "cert_manager_keyvault_cert_name" {
description = "Keyvault certificate name to use for cert-manager. Required if cluster issuer is keyvault"
type = string
default = null
}
variable "clusterissuer" {
description = "Cluster Issuer name to use for certs"
type = string
default = "letsencrypt-prod"
validation {
condition = contains(["letsencrypt-prod", "vaas-issuer", "keyvault", "adcs-issuer"], var.clusterissuer)
error_message = "clusterissuer must be one of: letsencrypt-prod, vaas-issuer, keyvault, adcs-issuer"
}
}
variable "clusterissuer_email" {
description = "The email address to use for the cert-manager cluster issuer."
type = string
}
variable "cluster_version" {
description = "The Kubernetes version to use for the AKS cluster."
type = string
default = "1.30"
}
variable "cluster_nodepool_version" {
description = "The Kubernetes version to use for the AKS cluster Nodepools."
type = string
default = "1.30"
}
variable "create_duration_delay" {
type = object({
azurerm_role_definition = optional(string, "180s")
kubectl_manifest_cloud_identity = optional(string, "30s")
})
description = "Used to tune terraform apply when faced with errors caused by API caching or eventual consistency. Sets a custom delay period after creation of the specified resource type."
default = {}
validation {
condition = can([for v in values(var.create_duration_delay) : regex("^[0-9]{1,6}(s|m|h)$", v)])
error_message = "The create_duration_delay values must be a string containing the duration in numbers (1-6 digits) followed by the measure of time represented by s (seconds), m (minutes), or h (hours)."
}
}
variable "create_localadmin_user" {
description = "Whether to create a localadmin user for access to the Wayfinder Portal and API"
type = bool
default = true
}
variable "destroy_duration_delay" {
type = object({
azurerm_role_definition = optional(string, "0s")
kubectl_manifest_cloud_identity = optional(string, "60s")
})
description = "Used to tune terraform destroy when faced with errors caused by API caching or eventual consistency. Sets a custom delay period after destruction of the specified resource type."
default = {}
validation {
condition = can([for v in values(var.destroy_duration_delay) : regex("^[0-9]{1,6}(s|m|h)$", v)])
error_message = "The destroy_duration_delay values must be a string containing the duration in numbers (1-6 digits) followed by the measure of time represented by s (seconds), m (minutes), or h (hours)."
}
}
variable "disable_internet_access" {
description = "Whether to disable internet access for AKS and the Wayfinder ingress controller"
type = bool
default = false
}
variable "disable_local_login" {
description = "Whether to disable local login for Wayfinder. Note: An IDP must be configured within Wayfinder, otherwise you will not be able to log in."
type = bool
default = false
}
variable "dns_provider" {
description = "DNS provider for External DNS"
type = string
default = "azure"
}
variable "dns_zone_id" {
description = "The ID of the Azure DNS Zone to use."
type = string
}
variable "dns_resource_group_id" {
description = "The ID of the resource group where the DNS Zone exists, if different to Wayfinder's resource group."
type = string
default = ""
}
variable "dns_zone_name" {
description = "The name of the Azure DNS zone to use."
type = string
}
variable "enable_k8s_resources" {
description = "Whether to enable the creation of Kubernetes resources for Wayfinder (helm and kubectl manifest deployments)"
type = bool
default = true
}
variable "enable_wf_cloudaccess" {
description = "Whether to configure CloudIdentity and admin CloudAccessConfig resources in Wayfinder once installed (requires enable_k8s_resources)"
type = bool
default = true
}
variable "enable_wf_privatelinks" {
description = "Whether to configure admin CloudAccessConfig for Private Link Management in the account wayfinder is installed in once installed (requires enable_k8s_resources and enable_wf_cloudaccess)"
type = bool
default = false
}
variable "enable_cross_tenant_access" {
description = "Whether to enable cross-tenant access for Wayfinder. Will create a suitable Enterprise Application with federated credential for Wayfinder to use."
type = bool
default = false
}
variable "enable_wf_costestimates" {
description = "Whether to configure admin CloudAccessConfig for cost estimates in the account Wayfinder is installed in once installed (requires enable_k8s_resources and enable_wf_cloudaccess)"
type = bool
default = true
}
variable "enable_wf_dnszonemanager" {
description = "Whether to configure admin CloudAccessConfig for DNS zone management in the account Wayfinder is installed in once installed (requires enable_k8s_resources and enable_wf_cloudaccess)"
type = bool
default = false
}
variable "environment" {
description = "The environment in which the resources are deployed."
type = string
default = "production"
}
variable "location" {
description = "The Azure region to use."
type = string
default = "uksouth"
}
variable "private_dns_zone_id" {
description = "Private DNS zone to use for private clusters"
type = string
default = null
}
variable "resource_group_name" {
description = "The name of the resource group in which to create the AKS cluster."
type = string
}
variable "private_link_resourcegroup" {
description = "The name of the resource group in which to create central private link resources for each AKS cluster."
type = string
default = ""
}
variable "tags" {
description = "A mapping of tags to assign to resources."
type = map(string)
default = {}
}
variable "user_assigned_identity" {
description = "MSI id for AKS to run as"
type = string
}
variable "venafi_apikey" {
description = "Venafi API key - required if using Venafi cluster issuer"
type = string
default = ""
sensitive = true
}
variable "venafi_zone" {
description = "Venafi zone - required if using Venafi cluster issuer"
type = string
default = ""
}
variable "wayfinder_domain_name_api" {
description = "The domain name to use for the Wayfinder API (e.g. api.wayfinder.example.com)"
type = string
}
variable "wayfinder_domain_name_ui" {
description = "The domain name to use for the Wayfinder UI (e.g. portal.wayfinder.example.com)"
type = string
}
variable "wayfinder_idp_details" {
description = "The IDP details to use for Wayfinder to enable SSO"
type = object({
type = string
clientId = optional(string)
clientSecret = optional(string)
serverUrl = optional(string)
azureTenantId = optional(string)
})
sensitive = true
validation {
condition = contains(["generic", "aad", "none"], var.wayfinder_idp_details["type"])
error_message = "wayfinder_idp_details[\"type\"] must be one of: generic, aad, none"
}
validation {
condition = var.wayfinder_idp_details["type"] == "none" || (var.wayfinder_idp_details["type"] == "generic" && length(var.wayfinder_idp_details["serverUrl"]) > 0) || (var.wayfinder_idp_details["type"] == "aad" && length(var.wayfinder_idp_details["azureTenantId"]) > 0)
error_message = "serverUrl must be set if IDP type is generic, azureTenantId must be set if IDP type is aad"
}
default = {
type = "none"
clientId = null
clientSecret = null
serverUrl = ""
azureTenantId = ""
}
}
variable "wayfinder_instance_id" {
description = "The instance ID to use for Wayfinder."
type = string
validation {
condition = can(regex("^[a-z0-9]{10,20}$", var.wayfinder_instance_id))
error_message = "The Wayfinder Instance ID must be alphanumeric and 10-20 characters long."
}
}
variable "wayfinder_licence_key" {
description = "The licence key to use for Wayfinder"
type = string
sensitive = true
}
variable "wayfinder_no_defaults" {
description = "Set to true to stop Wayfinder from applying compiled-in defaults (e.g. default roles, cluster plans, etc)."
type = bool
default = true
}
variable "wayfinder_release_channel" {
description = "The release channel to use for Wayfinder"
type = string
default = "wayfinder-releases"
}
variable "wayfinder_version" {
description = "The version to use for Wayfinder"
type = string
default = "v2.9.8"
}