Is there an existing issue for this?
Greenfield/Brownfield provisioning
greenfield
Terraform Version
1.4.2
Module Version
6.7.1
AzureRM Provider Version
v3.49.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
module "aks" {
source = "Azure/aks/azurerm"
version = "6.7.1"
kubernetes_version = "1.25"
orchestrator_version = null
automatic_channel_upgrade = "patch"
[..CUT..]
}
tfvars variables values
Debug Output/Panic Output
~ resource "azurerm_kubernetes_cluster" "main" {
id = "{REDACTED}"
~ kubernetes_version = "1.25.6" -> "1.25"
Expected Behaviour
Terraform should not have state drift when an automatic upgrade happens in the patch channel.
Actual Behaviour
When creating the cluster the AKS API returns this values:
az aks show --name istio-aks -g istio-aks -o json | jq ".kubernetesVersion, .currentKubernetesVersion"
"1.25"
"1.25.5"
After an automatic upgrade ( automatic_channel_upgrade=patch ) the AKS API will return something like:
az aks show --name istio-aks -g istio-aks -o json | jq ".kubernetesVersion, .currentKubernetesVersion"
"1.25.6"
"1.25.6"
Because Terraform saved in the state:
"kubernetes_version": "1.25",
This will cause a Terraform state drift at the next terraform apply operation.
Steps to Reproduce
terraform apply with this minimal config:
module "aks" {
source = "Azure/aks/azurerm"
version = "6.7.1"
kubernetes_version = "1.25"
orchestrator_version = null
automatic_channel_upgrade = "patch"
[..CUT..]
}
Wait for an automatic upgrade to happen and run again terraform apply
Important Factoids
No response
References
No response
Is there an existing issue for this?
Greenfield/Brownfield provisioning
greenfield
Terraform Version
1.4.2
Module Version
6.7.1
AzureRM Provider Version
v3.49.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
tfvars variables values
Debug Output/Panic Output
Expected Behaviour
Terraform should not have state drift when an automatic upgrade happens in the
patchchannel.Actual Behaviour
When creating the cluster the AKS API returns this values:
After an automatic upgrade (
automatic_channel_upgrade=patch) the AKS API will return something like:Because Terraform saved in the state:
This will cause a Terraform state drift at the next
terraform applyoperation.Steps to Reproduce
terraform applywith this minimal config:Wait for an automatic upgrade to happen and run again
terraform applyImportant Factoids
No response
References
No response