@@ -700,7 +700,7 @@ resource "time_sleep" "interval_before_cluster_update" {
700700
701701resource "azapi_update_resource" "aks_cluster_post_create" {
702702 resource_id = azurerm_kubernetes_cluster. main . id
703- type = " Microsoft.ContainerService/managedClusters@2024-02-01 "
703+ type = " Microsoft.ContainerService/managedClusters@${ local . aks_managed_clusters_api_version } "
704704 body = {
705705 properties = {
706706 kubernetesVersion = var.kubernetes_version
@@ -729,7 +729,7 @@ resource "azapi_update_resource" "aks_cluster_http_proxy_config_no_proxy" {
729729 count = can (var. http_proxy_config . no_proxy [0 ]) ? 1 : 0
730730
731731 resource_id = azurerm_kubernetes_cluster. main . id
732- type = " Microsoft.ContainerService/managedClusters@2024-02-01 "
732+ type = " Microsoft.ContainerService/managedClusters@${ local . aks_managed_clusters_api_version } "
733733 body = {
734734 properties = {
735735 httpProxyConfig = {
@@ -759,34 +759,30 @@ resource "azapi_update_resource" "aks_cluster_localdns_config" {
759759 count = var. localdns_config != null ? 1 : 0
760760
761761 resource_id = azurerm_kubernetes_cluster. main . id
762- type = " Microsoft.ContainerService/managedClusters@2024-02-01 "
762+ type = " Microsoft.ContainerService/managedClusters@${ local . aks_managed_clusters_api_version } "
763763 body = {
764764 properties = {
765- localDNSConfig = {
765+ localDNSProfile = {
766766 mode = var.localdns_config.mode
767767 vnetDNSOverrides = var.localdns_config.vnet_dns_overrides != null ? {
768- for zone_name , zone_config in var . localdns_config . vnet_dns_overrides . zones : zone_name => {
769- queryLogging = zone_config.query_logging
770- protocol = zone_config.protocol
771- forwardDestination = zone_config.forward_destination
772- forwardPolicy = zone_config.forward_policy
773- maxConcurrent = zone_config.max_concurrent
774- cacheDurationInSeconds = zone_config.cache_duration_in_seconds
775- serveStaleDurationInSeconds = zone_config.serve_stale_duration_in_seconds
776- serveStale = zone_config.serve_stale
777- }
768+ queryLogging = var.localdns_config.vnet_dns_overrides.query_logging
769+ protocol = var.localdns_config.vnet_dns_overrides.protocol
770+ forwardDestination = var.localdns_config.vnet_dns_overrides.forward_destination
771+ forwardPolicy = var.localdns_config.vnet_dns_overrides.forward_policy
772+ maxConcurrent = var.localdns_config.vnet_dns_overrides.max_concurrent
773+ cacheDurationInSeconds = var.localdns_config.vnet_dns_overrides.cache_duration_in_seconds
774+ serveStaleDurationInSeconds = var.localdns_config.vnet_dns_overrides.serve_stale_duration_in_seconds
775+ serveStale = var.localdns_config.vnet_dns_overrides.serve_stale
778776 } : null
779777 kubeDNSOverrides = var.localdns_config.kube_dns_overrides != null ? {
780- for zone_name , zone_config in var . localdns_config . kube_dns_overrides . zones : zone_name => {
781- queryLogging = zone_config.query_logging
782- protocol = zone_config.protocol
783- forwardDestination = zone_config.forward_destination
784- forwardPolicy = zone_config.forward_policy
785- maxConcurrent = zone_config.max_concurrent
786- cacheDurationInSeconds = zone_config.cache_duration_in_seconds
787- serveStaleDurationInSeconds = zone_config.serve_stale_duration_in_seconds
788- serveStale = zone_config.serve_stale
789- }
778+ queryLogging = var.localdns_config.kube_dns_overrides.query_logging
779+ protocol = var.localdns_config.kube_dns_overrides.protocol
780+ forwardDestination = var.localdns_config.kube_dns_overrides.forward_destination
781+ forwardPolicy = var.localdns_config.kube_dns_overrides.forward_policy
782+ maxConcurrent = var.localdns_config.kube_dns_overrides.max_concurrent
783+ cacheDurationInSeconds = var.localdns_config.kube_dns_overrides.cache_duration_in_seconds
784+ serveStaleDurationInSeconds = var.localdns_config.kube_dns_overrides.serve_stale_duration_in_seconds
785+ serveStale = var.localdns_config.kube_dns_overrides.serve_stale
790786 } : null
791787 }
792788 }
0 commit comments