Open hgebrael opened 1 year ago
Hi @hgebrael ,
Thank you for taking time to report this issue!
I tried to reproduce it but failed, here's what I did:
enable_host_encryption = false
in Terraform.enable_host_encryption = true
with azure clienable_host_encryption = true
, terraform shows no changes.@ms-henglu I also hit this problem when changing availability zones. Before: nodes = 2 syspool = zones 1, 2
after nodes = 3 syspool = zones 1,2,3 (west europe)
Hi @ms-henglu, the same issue occurred with my Terraform code when I changed from 'default_node_pool' with 'os_sku' set to 'Ubuntu' to 'AzureLinux'.
My code is as below:
resource "azurerm_kubernetes_cluster" "aks_cluster" { name = "${local.env}-${local.aks_name}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location kubernetes_version = local.aks_version sku_tier = "Free" oidc_issuer_enabled = true workload_identity_enabled = true automatic_channel_upgrade = "patch" private_cluster_enabled = false dns_prefix = "devaks1" node_resource_group = "${local.resource_group_name}-${local.env}-${local.aks_name}" network_profile { network_plugin = "azure" dns_service_ip = "10.0.64.10" service_cidr = "10.0.64.0/19" } default_node_pool { name = "agentpool" vm_size = "standard_b2s" vnet_subnet_id = azurerm_subnet.private.id orchestrator_version = local.aks_version type = "VirtualMachineScaleSets" enable_auto_scaling = true node_count = 1 min_count = 1 max_count = 10 os_sku = "AzureLinux"
node_labels = {
role = "agentpool"
}
} identity { type = "UserAssigned" identity_ids = [azurerm_user_assigned_identity.base.id] }
tags = { env = local.env }
lifecycle { ignore_changes = [default_node_pool[0].node_count] }
depends_on = [ azurerm_role_assignment.base ] }
Error:
Error: temporary_name_for_rotation
must be specified when updating any of the following properties ["default_node_pool.0.name" "default_node_pool.0.enable_host_encryption" "default_node_pool.0.enable_node_public_ip" "default_node_pool.0.kubelet_config" "default_node_pool.0.linux_os_config" "default_node_pool.0.max_pods" "default_node_pool.0.node_taints" "default_node_pool.0.only_critical_addons_enabled" "default_node_pool.0.os_disk_size_gb" "default_node_pool.0.os_disk_type" "default_node_pool.0.os_sku" "default_node_pool.0.pod_subnet_id" "default_node_pool.0.snapshot_id" "default_node_pool.0.ultra_ssd_enabled" "default_node_pool.0.vnet_subnet_id" "default_node_pool.0.vm_size" "default_node_pool.0.zones"]
@ms-henglu Please set the temporary_name_for_rotation property should be required inside default_node_pool instead of optional.
@fabio-s-franco & @hgebrael issue is resolved when I have added temporary_name_for_rotation into default_node_pool.
Is there an existing issue for this?
Community Note
Terraform Version
1.5.5
AzureRM Provider Version
3.69.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform should not request for temporary_name_for_rotation when adding the enable_host_encryption to the configuration because its value did not change.
The logic should be: if enable_host_encryption value changed, specify temporary_name_for_rotation otherwise do not specify this attribute.
Actual Behaviour
terraform always asks for adding the temporary_name_for_rotation and performing a recycling on nodepool even if the attribute enable_host_encryption did not change.
Steps to Reproduce
Terraform apply
Important Factoids
No response
References
No response