Interview Prep/Azure/Azure DevOps, Bicep and Terraform

Why does Terraform sometimes want to replace an AKS cluster?

AdvancedConceptAzure DevOps, Bicep and Terraform
Answer

Some fields are ForceNew: changing dns_prefix, network_profile attributes like network_plugin (some transitions), node_resource_group, private cluster settings, or the default node pool's vm_size, zones or subnet (unless temporary_name_for_rotation is set, which lets azurerm rotate the default pool instead).

Always read the plan for -/+ destroy and then create replacement on the cluster. Protect with lifecycle { prevent_destroy = true } in prod, and change immutable node pool properties by adding a new pool and migrating workloads.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on Azure DevOps, Bicep and Terraform