Closed BriceLag closed 2 years ago
Hi @BriceLag ,
From the document, https://registry.terraform.io/providers/hashicorp/azurerm/3.0.0/docs/resources/kubernetes_cluster#automatic_channel_upgrade
Omitting this field sets this value to
none
.
Hi @ms-henglu, Thank you for your answer. But how can I wrote a module, to let the user choose the value, or back to 'none' on that parameter with terraform ? Best regards,
Brice
Hi @BriceLag ,
You can use value null
, more information can be found here
Thank you @ms-henglu .
For people who search a solution, to implement it in a module, I propose that one:
variable "automatic_channel_upgrade" {
type = string
description = "(Optional) The upgrade channel for this Kubernetes Cluster. Possible values are: null, 'patch', 'rapid', 'node-image' and 'stable'. Omitting this field sets this value to none. ⚠ Cluster Auto-Upgrade will update the Kubernetes Cluster (and its Node Pools) to the latest GA version of Kubernetes automatically"
default = null
validation {
condition = (var.automatic_channel_upgrade == null ? true : contains(["patch", "rapid", "node-image", "stable"], var.automatic_channel_upgrade))
error_message = "Must be: 'patch', 'rapid', 'node-image' and 'stable'. Default value: null."
}
}
I hope that one day this argument can accept 'none', as in the Azure documentation. :-)
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.
Is there an existing issue for this?
Community Note
Terraform Version
1.2.4
AzureRM Provider Version
3.13.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
azurerm_kubernetes_cluster.example will be created
Actual Behaviour
Error: expected automatic_channel_upgrade to be one of [patch rapid stable node-image], got none
Steps to Reproduce
No response
Important Factoids
No response
References
Hello team, Thank you for your job. Following the documentation: https://registry.terraform.io/providers/hashicorp/azurerm/3.0.0/docs/resources/kubernetes_cluster#automatic_channel_upgrade I was expecting that the value "none" can be set on the argument: automatic_channel_upgrade. But he can't. Other github issue about that problem here: https://github.com/hashicorp/terraform-provider-azurerm/issues/11030.
In other hand I've perform the action manually on my cluster following this documentation: https://docs.microsoft.com/en-us/azure/aks/auto-upgrade-cluster. I've set the auto-upgrade-channel of my cluster from "none", to "stable" and back to "none" whitout any problem.
az aks show --resource-group example-resources --name example-aks1 | grep -i chann
az aks update --resource-group example-resources --name example-aks1 --auto-upgrade-channel none
Can you do something ? Best regards,Brice