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.
More on Azure DevOps, Bicep and Terraform
What services make up Azure DevOps?BeginnerWhat are branch policies in Azure Repos?BeginnerExplain the YAML pipeline structure in Azure Pipelines.BeginnerWhat are service connections and how should they authenticate?IntermediateWhat are environments in Azure Pipelines?IntermediateWhat deployment strategies do deployment jobs support?Intermediate