I am trying to provision a private AKS cluster using terraform. I want to connect my private AKS cluster to an existing VNET that I have created using the Azure portal.
The Virtual network option is available in the Azure portal. Please find the below image.
However, the terraform documentation on azurerm_kubernetes_cluster has very limited information on how to achieve that.
Please find my main.tf below
resource "azurerm_kubernetes_cluster" "kubernetes_cluster" { name = var.cluster_name location = var.location resource_group_name = var.resource_group_name private_cluster_enabled = true default_node_pool { name = "default" node_count = var.node_count vm_size = var.vm_size max_pods = var.max_pods_count } kube_dashboard { enabled = true } network_profile { network_plugin = "azure" } } Please note that the VNET and the cluster that is to be created share the same location and resource group.
Any help on how to provision a private AKS cluster to an existing VNET using Terraform would be much appreciated.




