forked from Azure/terraform-azurerm-aks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
452 lines (380 loc) · 16.1 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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
variable "resource_group_name" {
description = "The resource group name to be imported"
type = string
}
variable "cluster_name" {
description = "(Optional) The name for the AKS resources created in the specified Azure Resource Group. This variable overwrites the 'prefix' var (The 'prefix' var will still be applied to the dns_prefix if it is set)"
type = string
default = null
}
variable "cluster_log_analytics_workspace_name" {
description = "(Optional) The name of the Analytics workspace"
type = string
default = null
}
variable "location" {
description = "Location of cluster, if not defined it will be read from the resource-group"
type = string
default = null
}
variable "prefix" {
description = "(Required) The prefix for the resources created in the specified Azure Resource Group"
type = string
}
variable "client_id" {
description = "(Optional) The Client ID (appId) for the Service Principal used for the AKS deployment"
type = string
default = ""
nullable = false
}
variable "client_secret" {
description = "(Optional) The Client Secret (password) for the Service Principal used for the AKS deployment"
type = string
default = ""
nullable = false
}
variable "api_server_authorized_ip_ranges" {
type = set(string)
description = "(Optional) The IP ranges to allow for incoming traffic to the server nodes."
default = null
}
variable "admin_username" {
default = null
description = "The username of the local administrator to be created on the Kubernetes cluster. Set this variable to `null` to turn off the cluster's `linux_profile`. Changing this forces a new resource to be created."
type = string
}
variable "agents_size" {
default = "Standard_D2s_v3"
description = "The default virtual machine size for the Kubernetes agents"
type = string
}
variable "log_analytics_workspace_sku" {
description = "The SKU (pricing level) of the Log Analytics workspace. For new subscriptions the SKU should be set to PerGB2018"
type = string
default = "PerGB2018"
}
variable "log_retention_in_days" {
description = "The retention period for the logs in days"
type = number
default = 30
}
variable "agents_count" {
description = "The number of Agents that should exist in the Agent Pool. Please set `agents_count` `null` while `enable_auto_scaling` is `true` to avoid possible `agents_count` changes."
type = number
default = 2
}
variable "public_ssh_key" {
description = "A custom ssh key to control access to the AKS cluster. Changing this forces a new resource to be created."
type = string
default = ""
}
variable "tags" {
type = map(string)
description = "Any tags that should be present on the AKS cluster resources"
default = {}
}
variable "enable_log_analytics_workspace" {
type = bool
description = "Enable the integration of azurerm_log_analytics_workspace and azurerm_log_analytics_solution: https://docs.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-onboard"
default = true
nullable = false
}
variable "log_analytics_solution_id" {
type = string
description = "(Optional) Existing azurerm_log_analytics_solution ID. Providing ID disables creation of azurerm_log_analytics_solution."
default = null
nullable = true
}
variable "log_analytics_workspace" {
type = object({
id = string
name = string
})
description = "(Optional) Existing azurerm_log_analytics_workspace to attach azurerm_log_analytics_solution. Providing the config disables creation of azurerm_log_analytics_workspace."
default = null
nullable = true
}
variable "log_analytics_workspace_resource_group_name" {
type = string
description = "(Optional) Resource group name to create azurerm_log_analytics_solution."
default = null
nullable = true
}
variable "vnet_subnet_id" {
description = "(Optional) The ID of a Subnet where the Kubernetes Node Pool should exist. Changing this forces a new resource to be created."
type = string
default = null
}
variable "os_disk_size_gb" {
description = "Disk size of nodes in GBs."
type = number
default = 50
}
variable "os_disk_type" {
description = "The type of disk which should be used for the Operating System. Possible values are `Ephemeral` and `Managed`. Defaults to `Managed`. Changing this forces a new resource to be created."
type = string
default = "Managed"
nullable = false
}
variable "private_cluster_enabled" {
description = "If true cluster API server will be exposed only on internal IP address and available only in cluster vnet."
type = bool
default = false
}
variable "enable_http_application_routing" {
description = "Enable HTTP Application Routing Addon (forces recreation)."
type = bool
default = false
}
variable "azure_policy_enabled" {
description = "Enable Azure Policy Addon."
type = bool
default = false
}
variable "enable_open_service_mesh" {
description = "Is Open Service Mesh enabled? For more details, please visit [Open Service Mesh for AKS](https://docs.microsoft.com/azure/aks/open-service-mesh-about)."
type = bool
default = null
}
variable "sku_tier" {
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Paid"
type = string
default = "Free"
}
variable "enable_role_based_access_control" {
description = "Enable Role Based Access Control."
type = bool
default = false
nullable = false
}
variable "rbac_aad_managed" {
description = "Is the Azure Active Directory integration Managed, meaning that Azure will create/manage the Service Principal used for integration."
type = bool
default = false
nullable = false
}
variable "rbac_aad_admin_group_object_ids" {
description = "Object ID of groups with admin access."
type = list(string)
default = null
}
variable "rbac_aad_azure_rbac_enabled" {
description = "(Optional) Is Role Based Access Control based on Azure AD enabled?"
type = bool
default = null
}
variable "rbac_aad_tenant_id" {
description = "(Optional) The Tenant ID used for Azure Active Directory Application. If this isn't specified the Tenant ID of the current Subscription is used."
type = string
default = null
}
variable "rbac_aad_client_app_id" {
description = "The Client ID of an Azure Active Directory Application."
type = string
default = null
}
variable "rbac_aad_server_app_id" {
description = "The Server ID of an Azure Active Directory Application."
type = string
default = null
}
variable "rbac_aad_server_app_secret" {
description = "The Server Secret of an Azure Active Directory Application."
type = string
default = null
}
variable "network_plugin" {
description = "Network plugin to use for networking."
type = string
default = "kubenet"
nullable = false
}
variable "network_policy" {
description = " (Optional) Sets up network policy to be used with Azure CNI. Network policy allows us to control the traffic flow between pods. Currently supported values are calico and azure. Changing this forces a new resource to be created."
type = string
default = null
}
variable "net_profile_dns_service_ip" {
description = "(Optional) IP address within the Kubernetes service address range that will be used by cluster service discovery (kube-dns). Changing this forces a new resource to be created."
type = string
default = null
}
variable "net_profile_docker_bridge_cidr" {
description = "(Optional) IP address (in CIDR notation) used as the Docker bridge IP address on nodes. Changing this forces a new resource to be created."
type = string
default = null
}
variable "net_profile_outbound_type" {
description = "(Optional) The outbound (egress) routing method which should be used for this Kubernetes Cluster. Possible values are loadBalancer and userDefinedRouting. Defaults to loadBalancer."
type = string
default = "loadBalancer"
}
variable "net_profile_pod_cidr" {
description = " (Optional) The CIDR to use for pod IP addresses. This field can only be set when network_plugin is set to kubenet. Changing this forces a new resource to be created."
type = string
default = null
}
variable "net_profile_service_cidr" {
description = "(Optional) The Network Range used by the Kubernetes service. Changing this forces a new resource to be created."
type = string
default = null
}
variable "kubernetes_version" {
description = "Specify which Kubernetes release to use. The default used is the latest Kubernetes version available in the region"
type = string
default = null
}
variable "orchestrator_version" {
description = "Specify which Kubernetes release to use for the orchestration layer. The default used is the latest Kubernetes version available in the region"
type = string
default = null
}
variable "enable_auto_scaling" {
description = "Enable node pool autoscaling"
type = bool
default = false
}
variable "agents_max_count" {
type = number
description = "Maximum number of nodes in a pool"
default = null
}
variable "agents_min_count" {
type = number
description = "Minimum number of nodes in a pool"
default = null
}
variable "agents_pool_name" {
description = "The default Azure AKS agentpool (nodepool) name."
type = string
default = "nodepool"
nullable = false
}
variable "enable_node_public_ip" {
description = "(Optional) Should nodes in this Node Pool have a Public IP Address? Defaults to false."
type = bool
default = false
}
variable "agents_availability_zones" {
description = "(Optional) A list of Availability Zones across which the Node Pool should be spread. Changing this forces a new resource to be created."
type = list(string)
default = null
}
variable "agents_labels" {
description = "(Optional) A map of Kubernetes labels which should be applied to nodes in the Default Node Pool. Changing this forces a new resource to be created."
type = map(string)
default = {}
}
variable "agents_type" {
description = "(Optional) The type of Node Pool which should be created. Possible values are AvailabilitySet and VirtualMachineScaleSets. Defaults to VirtualMachineScaleSets."
type = string
default = "VirtualMachineScaleSets"
}
variable "agents_tags" {
description = "(Optional) A mapping of tags to assign to the Node Pool."
type = map(string)
default = {}
}
variable "agents_max_pods" {
description = "(Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
type = number
default = null
}
variable "enable_ingress_application_gateway" {
description = "Whether to deploy the Application Gateway ingress controller to this Kubernetes Cluster?"
type = bool
default = false
nullable = false
}
variable "ingress_application_gateway_id" {
description = "The ID of the Application Gateway to integrate with the ingress controller of this Kubernetes Cluster."
type = string
default = null
}
variable "ingress_application_gateway_name" {
description = "The name of the Application Gateway to be used or created in the Nodepool Resource Group, which in turn will be integrated with the ingress controller of this Kubernetes Cluster."
type = string
default = null
}
variable "ingress_application_gateway_subnet_cidr" {
description = "The subnet CIDR to be used to create an Application Gateway, which in turn will be integrated with the ingress controller of this Kubernetes Cluster."
type = string
default = null
}
variable "ingress_application_gateway_subnet_id" {
description = "The ID of the subnet on which to create an Application Gateway, which in turn will be integrated with the ingress controller of this Kubernetes Cluster."
type = string
default = null
}
variable "identity_type" {
description = "(Optional) The type of identity used for the managed cluster. Conflict with `client_id` and `client_secret`. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned`(to enable both). If `UserAssigned` or `SystemAssigned, UserAssigned` is set, an `identity_ids` must be set as well."
type = string
default = "SystemAssigned"
validation {
condition = var.identity_type == "SystemAssigned" || var.identity_type == "UserAssigned" || var.identity_type == "SystemAssigned, UserAssigned"
error_message = "`identity_type`'s possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned`(to enable both)."
}
}
variable "identity_ids" {
description = "(Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to this Kubernetes Cluster."
type = list(string)
default = null
}
variable "enable_host_encryption" {
description = "Enable Host Encryption for default node pool. Encryption at host feature must be enabled on the subscription: https://docs.microsoft.com/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli"
type = bool
default = false
}
variable "private_dns_zone_id" {
description = "(Optional) Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise cluster will have issues after provisioning. Changing this forces a new resource to be created."
type = string
default = null
}
variable "private_cluster_public_fqdn_enabled" {
description = "(Optional) Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`."
type = bool
default = false
}
variable "node_resource_group" {
description = "The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster. Changing this forces a new resource to be created."
type = string
default = null
}
variable "disk_encryption_set_id" {
description = "(Optional) The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information [can be found in the documentation](https://docs.microsoft.com/azure/aks/azure-disk-customer-managed-keys). Changing this forces a new resource to be created."
type = string
default = null
}
variable "oidc_issuer_enabled" {
description = "Enable or Disable the OIDC issuer URL. Defaults to false."
type = bool
default = false
}
variable "only_critical_addons_enabled" {
description = "(Optional) Enabling this option will taint default node pool with `CriticalAddonsOnly=true:NoSchedule` taint. Changing this forces a new resource to be created."
type = bool
default = null
}
variable "key_vault_secrets_provider_enabled" {
description = "(Optional) Whether to use the Azure Key Vault Provider for Secrets Store CSI Driver in an AKS cluster. For more details: https://docs.microsoft.com/en-us/azure/aks/csi-secrets-store-driver"
type = bool
default = false
nullable = false
}
variable "secret_rotation_enabled" {
description = "Is secret rotation enabled? This variable is only used when enable_key_vault_secrets_provider is true and defaults to false"
type = bool
default = false
nullable = false
}
variable "secret_rotation_interval" {
description = "The interval to poll for secret rotation. This attribute is only set when secret_rotation is true and defaults to 2m"
type = string
default = "2m"
nullable = false
}
variable "local_account_disabled" {
description = "(Optional) - If `true` local accounts will be disabled. Defaults to `false`. See [the documentation](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts) for more information."
type = bool
default = null
}