Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_kubernetes_cluster - web_app_routing.dns_zone_ids has incorrect minimum item requirement #26717

Closed
1 task done
NickG158 opened this issue Jul 22, 2024 · 2 comments · Fixed by #26747
Closed
1 task done

Comments

@NickG158
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 comments along the lines of "+1", "me too" or "any updates", 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 and review the contribution guide to help.

Terraform Version

1.8.3

AzureRM Provider Version

3.113.0

Affected Resource(s)/Data Source(s)

azurerm_kubernetes_cluster

Terraform Configuration Files

resource "azurerm_resource_group" "default" {
  name     = "rgakstest"
  location = "westeurope"
}

resource "azurerm_kubernetes_cluster" "default" {
  name = "aks-test-cluster"
  dns_prefix = "testwebappissue"

  identity {
    type = "SystemAssigned"
  }

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_B2as_v2"
  }

  location            = "westeurope"
  resource_group_name = azurerm_resource_group.default.name

  web_app_routing {
    dns_zone_ids = []
  }
}

Debug Output/Panic Output

╷
│ Error: Not enough list items
│
│   with azurerm_kubernetes_cluster.default,
│   on resource_group.tf line 33, in resource "azurerm_kubernetes_cluster" "default":
│   33:     dns_zone_ids = []
│
│ Attribute web_app_routing.0.dns_zone_ids requires 1 item minimum, but config has only 0 declared.

Expected Behaviour

Plan should have seen there was no changes and completed without error.

Actual Behaviour

Since updating our terraform to use a list for dns_zone_ids in the web_app_routing block instead of the singular string dns_zone_id we have noticed the above error when passing an empty list ( [] ) to the dns_zone_ids property.

The docs suggest we should be passing an empty list, "If not using Bring-Your-Own DNS zones this property should be set to an empty list."

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#dns_zone_ids

I'd guess it's this line causing the error, as it sets a MinItems of 1:

https://github.com/hashicorp/terraform-provider-azurerm/pull/26117/files#diff-6a7f7d2789c7df9bc827ae00ddcf7d3fbf97b87d414313e0bf99fa55562b0090R440

Steps to Reproduce

Try to create an AKS cluster using the web app routing addon with dns_zone_ids set to an empty list.

Important Factoids

No response

References

#26117

@eissko
Copy link

eissko commented Jul 31, 2024

yeap. same on my side. it's not implemented according the description which says to use empty list but when empty list is used, the plan fails.

Copy link

github-actions bot commented Sep 7, 2024

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants