<p>AKS user node pools are recreating for every terraform run, but system node pool is not recreating.
Below is the code for system node pool</p>
<pre><code>resource &quot;azurerm_kubernetes_cluster&quot; &quot;aks_cluster&quot; {
#count = var.create_aks_cluster ? 1 : 0
name = var.aks_cluster_name
location = var.location
resource_group_name = var.resource_group_name
dns_prefix = var.dns_prefix
kubernetes_version = var.kubernetes_version
private_cluster_enabled = false
sku_tier = var.sku_tier
lifecycle {
ignore_changes = [
default_node_pool[0].node_count
]
}
</code></pre>
<p>below is the code for user node pool</p>
<pre><code>resource &quot;azurerm_kubernetes_cluster_node_pool&quot; &quot;aks_cluster_user_pool&quot; {

  lifecycle {
    ignore_changes = [
      node_count
    ]
  }

  for_each = var.additional_node_pools

  kubernetes_cluster_id = azurerm_kubernetes_cluster.aks_cluster.id
  name                  = each.value.node_os == &quot;Linux&quot; ? substr(each.key, 0, 6) : substr(each.key, 0, 12)
  orchestrator_version  = var.kubernetes_version
  mode                  = &quot;User&quot;
  node_count            = each.value.node_count
  vm_size               = each.value.vm_size
  availability_zones    = each.value.zones
  enable_auto_scaling   = each.value.cluster_auto_scaling

  os_type   = each.value.node_os
  min_count = each.value.cluster_auto_scaling_min_count
  max_count = each.value.cluster_auto_scaling_max_count
  max_pods  = var.max_pods_per_node

  node_taints = each.value.taints
  #vnet_subnet_id        =var.subnet_aks_id
}
</code></pre>
<p>How to avoid recreating of user node pools? we are running terraform using azure pipeline</p>

satish p
<p>Because You have set <code>mode = &quot;User&quot;</code> in user_node_pool.</p>
<p>I think You have to create other node_pull with <code>mode = &quot;System&quot;</code>.</p>
