Skip to content
18 changes: 10 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ module "ssh-key" {
}

resource "azurerm_kubernetes_cluster" "main" {
name = var.cluster_name == null ? "${var.prefix}-aks" : var.cluster_name
kubernetes_version = var.kubernetes_version
location = coalesce(var.location, data.azurerm_resource_group.main.location)
resource_group_name = data.azurerm_resource_group.main.name
node_resource_group = var.node_resource_group
dns_prefix = var.prefix
sku_tier = var.sku_tier
private_cluster_enabled = var.private_cluster_enabled
name = var.cluster_name == null ? "${var.prefix}-aks" : var.cluster_name
kubernetes_version = var.kubernetes_version
location = coalesce(var.location, data.azurerm_resource_group.main.location)
resource_group_name = data.azurerm_resource_group.main.name
node_resource_group = var.node_resource_group
dns_prefix = var.prefix
sku_tier = var.sku_tier
private_cluster_enabled = var.private_cluster_enabled
private_dns_zone_id = var.private_dns_zone_id
private_cluster_public_fqdn_enabled = var.private_cluster_public_fqdn_enabled
Comment thread
iamamitgera marked this conversation as resolved.

linux_profile {
admin_username = var.admin_username
Expand Down
20 changes: 20 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,26 @@ variable "enable_host_encryption" {
default = false
}

variable "private_dns_zone_id" {
description = <<EOT
(Optional) Either the ID of Private DNS Zone which should be delegated to this Cluster,
or System to have AKS manage this or None.
Comment thread
iamamitgera marked this conversation as resolved.
Outdated
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.
EOT
type = string
default = null
}

variable "private_cluster_public_fqdn_enabled" {
description = <<EOT
(Optional) Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to false.
Comment thread
iamamitgera marked this conversation as resolved.
Outdated
EOT
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
Expand Down