terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

azurerm_kubernetes_service_versions data source add default stable version support

Open ianarsenault opened this issue 9 months ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

The azurerm_kubernetes_service_versions data source should have support for selecting stable version, not just latest version as these are different between terraform and the console

Right now if you want to use the data source the latest_version == 1.29.4 at time of creating this issue but the default version is 1.28.9. There's no way to easily select default without knowing what the prefix should be every time you deploy a AKS cluster

data "azurerm_kubernetes_service_versions" "current" {
  location = var.location
  include_preview = false
}

output "azure_aks_versions" {
  value = data.azurerm_kubernetes_service_versions.current
}
  + aks_versions = {
      + id              = "/subscriptions/<SUBSCRIPTION>/providers/Microsoft.ContainerService/locations/<REGION>"
      + include_preview = false
      + latest_version  = "1.29.4"
      + location        = "<region>"
      + timeouts        = null
      + version_prefix  = null
      + versions        = [
          + "1.29.4",
          + "1.29.2",
          + "1.28.9",
          + "1.28.5",
          + "1.27.9",
          + "1.27.7",
        ]
    }

In the console 1.28.9 is the default and this should be an option within terraform instead of needing to pass in prefix which requires knowing Azures current stable/default. In GCP/GKE they have a similar option data.google_container_engine_versions.gke_versions.release_channel_default_version["STABLE"] which would be great to have in AKS as we always want to deploy stable/default that's available in console in terraform deployments.

image

New or Affected Resource(s)/Data Source(s)

azurerm_kubernetes_service_versions

Potential Terraform Configuration

No response

References

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/kubernetes_service_versions

Community Note

  • Please vote on this issue by adding a :thumbsup: 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 and review the contribution guide to help.

ianarsenault avatar May 13 '24 17:05 ianarsenault

Hi @ianarsenault!

I filed a PR for it, will keep you updated.

aristosvo avatar May 14 '24 08:05 aristosvo

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[bot] avatar Jun 15 '24 02:06 github-actions[bot]