From 7dd0b5af87966a61d85c8ad312b28a5f6508b38a Mon Sep 17 00:00:00 2001 From: Nguyen Nhu Hieu <5441003+hieumoscow@users.noreply.github.com> Date: Mon, 20 Sep 2021 17:03:43 +0800 Subject: [PATCH 1/3] Update kubernetes_cluster_resource.go Fix #13099, to do in place update for `private_cluster_public_fqdn_enabled` --- internal/services/containers/kubernetes_cluster_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index d39046a9e485..26c1600261c5 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -593,7 +593,7 @@ func resourceKubernetesCluster() *pluginsdk.Resource { Type: pluginsdk.TypeBool, Optional: true, Default: false, - ForceNew: true, + ForceNew: false, }, "private_dns_zone_id": { From 8c29589dee193c3c36ee7708d0fc56ff433e17dc Mon Sep 17 00:00:00 2001 From: Nguyen Nhu Hieu <5441003+hieumoscow@users.noreply.github.com> Date: Tue, 21 Sep 2021 09:56:59 +0800 Subject: [PATCH 2/3] Update kubernetes_cluster_resource.go Fix per https://github.com/hashicorp/terraform-provider-azurerm/pull/13413#pullrequestreview-758607118 --- internal/services/containers/kubernetes_cluster_resource.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index 26c1600261c5..69dae5f79726 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -593,7 +593,6 @@ func resourceKubernetesCluster() *pluginsdk.Resource { Type: pluginsdk.TypeBool, Optional: true, Default: false, - ForceNew: false, }, "private_dns_zone_id": { @@ -1224,6 +1223,11 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{} existing.ManagedClusterProperties.APIServerAccessProfile.PrivateDNSZone = utils.String(v.(string)) } } + + if d.HasChange("private_cluster_public_fqdn_enabled") { + updateCluster = true + existing.ManagedClusterProperties.APIServerAccessProfile.EnablePrivateClusterPublicFQDN = utils.Bool(d.Get("private_cluster_public_fqdn_enabled").(bool)) + } if d.HasChange("auto_scaler_profile") { updateCluster = true From 4d2f947ba3168c6c7f6a54616628827f3b3cbd5b Mon Sep 17 00:00:00 2001 From: Hieu Nguyen Nhu <5441003+hieumoscow@users.noreply.github.com> Date: Thu, 23 Sep 2021 09:26:23 +0800 Subject: [PATCH 3/3] fmt --- .../services/containers/kubernetes_cluster_resource.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index 69dae5f79726..517fff0e7456 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -1223,11 +1223,11 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{} existing.ManagedClusterProperties.APIServerAccessProfile.PrivateDNSZone = utils.String(v.(string)) } } - + if d.HasChange("private_cluster_public_fqdn_enabled") { - updateCluster = true - existing.ManagedClusterProperties.APIServerAccessProfile.EnablePrivateClusterPublicFQDN = utils.Bool(d.Get("private_cluster_public_fqdn_enabled").(bool)) - } + updateCluster = true + existing.ManagedClusterProperties.APIServerAccessProfile.EnablePrivateClusterPublicFQDN = utils.Bool(d.Get("private_cluster_public_fqdn_enabled").(bool)) + } if d.HasChange("auto_scaler_profile") { updateCluster = true