Skip to content

Commit

Permalink
feat: add var automatic_channel_upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Nathaanel Liechti <[email protected]>
  • Loading branch information
the-technat committed Dec 9, 2022
1 parent 0d3b122 commit 07aef57
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ No modules.
| <a name="input_agents_tags"></a> [agents\_tags](#input\_agents\_tags) | (Optional) A mapping of tags to assign to the Node Pool. | `map(string)` | `{}` | no |
| <a name="input_agents_type"></a> [agents\_type](#input\_agents\_type) | (Optional) The type of Node Pool which should be created. Possible values are AvailabilitySet and VirtualMachineScaleSets. Defaults to VirtualMachineScaleSets. | `string` | `"VirtualMachineScaleSets"` | no |
| <a name="input_api_server_authorized_ip_ranges"></a> [api\_server\_authorized\_ip\_ranges](#input\_api\_server\_authorized\_ip\_ranges) | (Optional) The IP ranges to allow for incoming traffic to the server nodes. | `set(string)` | `null` | no |
| <a name="input_automatic_channel_upgrade"></a> [automatic\_channel\_upgrade](#input\_automatic\_channel\_upgrade) | (Optional) The upgrade channel for this Kubernetes Cluster. Possible values are `patch`, `rapid`, `node-image` and `stable`. By default automatic-upgrades are turned off. See [the documentation](https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-cluste) for more information | `string` | `null` | no |
| <a name="input_azure_policy_enabled"></a> [azure\_policy\_enabled](#input\_azure\_policy\_enabled) | Enable Azure Policy Addon. | `bool` | `false` | no |
| <a name="input_client_id"></a> [client\_id](#input\_client\_id) | (Optional) The Client ID (appId) for the Service Principal used for the AKS deployment | `string` | `""` | no |
| <a name="input_client_secret"></a> [client\_secret](#input\_client\_secret) | (Optional) The Client Secret (password) for the Service Principal used for the AKS deployment | `string` | `""` | no |
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "azurerm_kubernetes_cluster" "main" {
name = var.cluster_name == null ? "${var.prefix}-aks" : var.cluster_name
resource_group_name = data.azurerm_resource_group.main.name
api_server_authorized_ip_ranges = var.api_server_authorized_ip_ranges
automatic_channel_upgrade = var.automatic_channel_upgrade
azure_policy_enabled = var.azure_policy_enabled
disk_encryption_set_id = var.disk_encryption_set_id
dns_prefix = var.prefix
Expand Down Expand Up @@ -253,4 +254,4 @@ resource "azurerm_log_analytics_solution" "main" {
product = "OMSGallery/ContainerInsights"
publisher = "Microsoft"
}
}
}
19 changes: 15 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ variable "api_server_authorized_ip_ranges" {
default = null
}

variable "automatic_channel_upgrade" {
type = string
default = null
description = "(Optional) The upgrade channel for this Kubernetes Cluster. Possible values are `patch`, `rapid`, `node-image` and `stable`. By default automatic-upgrades are turned off. See [the documentation](https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-cluste) for more information"
validation {
condition = (
var.automatic_channel_upgrade == null || (
can(regex("(patch|rapid|stable|node-image)", var.automatic_channel_upgrade))
)
)
error_message = "`automatic_channel_upgrade`'s possible values are `patch`, `stable`, `rapid` or `node-image`."
}
}

variable "azure_policy_enabled" {
type = bool
description = "Enable Azure Policy Addon."
Expand Down Expand Up @@ -232,7 +246,6 @@ variable "log_analytics_solution_id" {
type = string
description = "(Optional) Existing azurerm_log_analytics_solution ID. Providing ID disables creation of azurerm_log_analytics_solution."
default = null
nullable = true
}

variable "log_analytics_workspace" {
Expand All @@ -242,7 +255,6 @@ variable "log_analytics_workspace" {
})
description = "(Optional) Existing azurerm_log_analytics_workspace to attach azurerm_log_analytics_solution. Providing the config disables creation of azurerm_log_analytics_workspace."
default = null
nullable = true
}

variable "log_analytics_workspace_enabled" {
Expand All @@ -256,7 +268,6 @@ variable "log_analytics_workspace_resource_group_name" {
type = string
description = "(Optional) Resource group name to create azurerm_log_analytics_solution."
default = null
nullable = true
}

variable "log_analytics_workspace_sku" {
Expand Down Expand Up @@ -501,4 +512,4 @@ variable "workload_identity_enabled" {
description = "Enable or Disable Workload Identity. Defaults to false."
type = bool
default = false
}
}

0 comments on commit 07aef57

Please sign in to comment.