Terraform-provider-azurerm: Case issue with Tags in AKS Default Node Pool resource

Created on 15 May 2020  ·  2Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.25
+ provider.azurerm v2.10.0

Affected Resource(s)

  • azurerm_kubernetes_cluster

Terraform Configuration Files

resource "azurerm_kubernetes_cluster" "collabora" {
  name                            = ...
  location                        = ...
  dns_prefix                      = "aks"
  resource_group_name             = ...
  api_server_authorized_ip_ranges = ...
  kubernetes_version              = "1.15.7"

  addon_profile {
    kube_dashboard {
      enabled = false
    }
    oms_agent {
      enabled                    = true
      log_analytics_workspace_id = ...
    }
  }

  default_node_pool {
    name                = "aks"
    availability_zones  = [1, 2, 3]
    vm_size             = "Standard_D4s_v3"
    vnet_subnet_id      = ...
    enable_auto_scaling = true
    node_count          = 3
    min_count           = 3
    max_count           = 20
    type                = "VirtualMachineScaleSets"
    tags                = {
      Environment = "Production"
    }
  }

  role_based_access_control {
    enabled = "true"
  }

  service_principal {
    client_id     = ...
    client_secret = ...
  }

  network_profile {
    network_plugin    = "azure"
    load_balancer_sku = "standard"
    load_balancer_profile {
      managed_outbound_ip_count = 1
    }
  }

  tags = {
    Environment = "Production"
  }
}

Expected Behavior

Applying the configuration should change the tags and setup the resource the first time. On the second run, nothing should be changed.

Actual Behavior

During the second run, the tags are attempted to be modified. It looks like because the tags that are already present are all lowercase.

Steps to Reproduce

  1. terraform apply
  2. terraform apply
bug servickubernetes-cluster upstream-microsoft

Most helpful comment

hi @ablyler

Thanks for opening this issue.

Unfortunately there's a bug in the Azure Compute API (which is used by the AKS API) where tags aren't updated if the keys have different casing but the same values. From Terraform's perspective we've documented this in the v2.5 release where it was first discovered - for which the underlying issue is this bug in the Compute API.

Since this is a bug in the Azure API - rather than something we can fix in Terraform, I'm going to close this issue for the moment - but I'd suggest subscribing to https://github.com/Azure/azure-rest-api-specs/issues/8982 for updates (where I've just asked for an update from the Compute Team).

Thanks!

All 2 comments

hi @ablyler

Thanks for opening this issue.

Unfortunately there's a bug in the Azure Compute API (which is used by the AKS API) where tags aren't updated if the keys have different casing but the same values. From Terraform's perspective we've documented this in the v2.5 release where it was first discovered - for which the underlying issue is this bug in the Compute API.

Since this is a bug in the Azure API - rather than something we can fix in Terraform, I'm going to close this issue for the moment - but I'd suggest subscribing to https://github.com/Azure/azure-rest-api-specs/issues/8982 for updates (where I've just asked for an update from the Compute Team).

Thanks!

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings