Skip to content

Commit 77098c2

Browse files
committed
feat!: rename variables for consistency with Azure resource schema
BREAKING CHANGES: - Rename �nable_auto_scaling to �uto_scaling_enabled in variables and node_pools - Rename �nable_host_encryption to host_encryption_enabled in variables and node_pools - Rename �nable_node_public_ip to ode_public_ip_enabled in variables and node_pools These changes align variable naming with Azure resource schema conventions and improve API consistency. Updated all references across: - Root module variables and main resources - Additional node pool resources - Example configurations - Documentation and upgrade notices Fixes #685
1 parent f6b7573 commit 77098c2

File tree

7 files changed

+53
-39
lines changed

7 files changed

+53
-39
lines changed

NoticeOnUpgradeTov11.0.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
# Notice on Upgrade to v10.x
1+
# Notice on Upgrade to v11.0
2+
3+
## AzureRM provider v3 support has been removed
24

35
`v11.0.0` removed support for Terraform AzureRM provider `v3` and removed `//v4` folder. All users need to use `Azure/aks/azurerm` instead of `Azure/aks/azurerm//v4` as module `source`.
6+
7+
## `var.enable_auto_scaling` has been renamed to `var.auto_scaling_enabled`
8+
9+
This change also affects the `node_pools` variable where `node_pools[*].enable_auto_scaling` should be replaced with `node_pools[*].auto_scaling_enabled`.
10+
11+
## `var.enable_host_encryption` has been renamed to `var.host_encryption_enabled`
12+
13+
This change also affects the `node_pools` variable where `node_pools[*].enable_host_encryption` should be replaced with `node_pools[*].host_encryption_enabled`.
14+
15+
## `var.enable_node_public_ip` has been renamed to `var.node_public_ip_enabled`
16+
17+
This change also affects the `node_pools` variable where `node_pools[*].enable_node_public_ip` should be replaced with `node_pools[*].node_public_ip_enabled`.

README.md

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

examples/application_gateway_ingress/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ module "aks" {
162162
]
163163
}
164164
]
165-
agents_type = "VirtualMachineScaleSets"
166-
azure_policy_enabled = true
167-
enable_auto_scaling = true
168-
enable_host_encryption = true
165+
agents_type = "VirtualMachineScaleSets"
166+
azure_policy_enabled = true
167+
auto_scaling_enabled = true
168+
host_encryption_enabled = true
169169
green_field_application_gateway_for_ingress = var.use_brown_field_application_gateway ? null : {
170170
name = "ingress"
171171
subnet_cidr = local.appgw_cidr

examples/startup/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ module "aks" {
6868
confidential_computing = {
6969
sgx_quote_helper_enabled = true
7070
}
71-
disk_encryption_set_id = azurerm_disk_encryption_set.des.id
72-
enable_auto_scaling = true
73-
enable_host_encryption = true
71+
disk_encryption_set_id = azurerm_disk_encryption_set.des.id
72+
auto_scaling_enabled = true
73+
host_encryption_enabled = true
7474
green_field_application_gateway_for_ingress = {
7575
name = "${random_id.prefix.hex}-agw"
7676
subnet_cidr = "10.52.1.0/24"

extra_node_pool.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_before_destroy
88

99
kubernetes_cluster_id = azurerm_kubernetes_cluster.main.id
1010
name = "${each.value.name}${substr(md5(uuid()), 0, 4)}"
11-
auto_scaling_enabled = each.value.enable_auto_scaling
11+
auto_scaling_enabled = each.value.auto_scaling_enabled
1212
capacity_reservation_group_id = each.value.capacity_reservation_group_id
1313
eviction_policy = each.value.eviction_policy
1414
fips_enabled = each.value.fips_enabled
1515
gpu_instance = each.value.gpu_instance
16-
host_encryption_enabled = each.value.enable_host_encryption
16+
host_encryption_enabled = each.value.host_encryption_enabled
1717
host_group_id = each.value.host_group_id
1818
kubelet_disk_type = each.value.kubelet_disk_type
1919
max_count = each.value.max_count
@@ -22,7 +22,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_before_destroy
2222
mode = each.value.mode
2323
node_count = each.value.node_count
2424
node_labels = each.value.node_labels
25-
node_public_ip_enabled = each.value.enable_node_public_ip
25+
node_public_ip_enabled = each.value.node_public_ip_enabled
2626
node_public_ip_prefix_id = each.value.node_public_ip_prefix_id
2727
node_taints = each.value.node_taints
2828
orchestrator_version = each.value.orchestrator_version
@@ -171,11 +171,11 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_after_destroy"
171171

172172
kubernetes_cluster_id = azurerm_kubernetes_cluster.main.id
173173
name = each.value.name
174-
auto_scaling_enabled = each.value.enable_auto_scaling
174+
auto_scaling_enabled = each.value.auto_scaling_enabled
175175
capacity_reservation_group_id = each.value.capacity_reservation_group_id
176176
eviction_policy = each.value.eviction_policy
177177
fips_enabled = each.value.fips_enabled
178-
host_encryption_enabled = each.value.enable_host_encryption
178+
host_encryption_enabled = each.value.host_encryption_enabled
179179
host_group_id = each.value.host_group_id
180180
kubelet_disk_type = each.value.kubelet_disk_type
181181
max_count = each.value.max_count
@@ -184,7 +184,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_after_destroy"
184184
mode = each.value.mode
185185
node_count = each.value.node_count
186186
node_labels = each.value.node_labels
187-
node_public_ip_enabled = each.value.enable_node_public_ip
187+
node_public_ip_enabled = each.value.node_public_ip_enabled
188188
node_public_ip_prefix_id = each.value.node_public_ip_prefix_id
189189
node_taints = each.value.node_taints
190190
orchestrator_version = each.value.orchestrator_version

main.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ resource "azurerm_kubernetes_cluster" "main" {
3939
workload_identity_enabled = var.workload_identity_enabled
4040

4141
dynamic "default_node_pool" {
42-
for_each = var.enable_auto_scaling == true ? [] : ["default_node_pool_manually_scaled"]
42+
for_each = var.auto_scaling_enabled == true ? [] : ["default_node_pool_manually_scaled"]
4343

4444
content {
4545
name = var.agents_pool_name
4646
vm_size = var.agents_size
47-
auto_scaling_enabled = var.enable_auto_scaling
47+
auto_scaling_enabled = var.auto_scaling_enabled
4848
fips_enabled = var.default_node_pool_fips_enabled
49-
host_encryption_enabled = var.enable_host_encryption
49+
host_encryption_enabled = var.host_encryption_enabled
5050
max_count = null
5151
max_pods = var.agents_max_pods
5252
min_count = null
5353
node_count = var.agents_count
5454
node_labels = var.agents_labels
55-
node_public_ip_enabled = var.enable_node_public_ip
55+
node_public_ip_enabled = var.node_public_ip_enabled
5656
only_critical_addons_enabled = var.only_critical_addons_enabled
5757
orchestrator_version = var.orchestrator_version
5858
os_disk_size_gb = var.os_disk_size_gb
@@ -160,19 +160,19 @@ resource "azurerm_kubernetes_cluster" "main" {
160160
}
161161
}
162162
dynamic "default_node_pool" {
163-
for_each = var.enable_auto_scaling == true ? ["default_node_pool_auto_scaled"] : []
163+
for_each = var.auto_scaling_enabled == true ? ["default_node_pool_auto_scaled"] : []
164164

165165
content {
166166
name = var.agents_pool_name
167167
vm_size = var.agents_size
168-
auto_scaling_enabled = var.enable_auto_scaling
168+
auto_scaling_enabled = var.auto_scaling_enabled
169169
fips_enabled = var.default_node_pool_fips_enabled
170-
host_encryption_enabled = var.enable_host_encryption
170+
host_encryption_enabled = var.host_encryption_enabled
171171
max_count = var.agents_max_count
172172
max_pods = var.agents_max_pods
173173
min_count = var.agents_min_count
174174
node_labels = var.agents_labels
175-
node_public_ip_enabled = var.enable_node_public_ip
175+
node_public_ip_enabled = var.node_public_ip_enabled
176176
only_critical_addons_enabled = var.only_critical_addons_enabled
177177
orchestrator_version = var.orchestrator_version
178178
os_disk_size_gb = var.os_disk_size_gb
@@ -644,7 +644,7 @@ resource "azurerm_kubernetes_cluster" "main" {
644644
error_message = "When `kubelet_identity` is enabled - The `type` field in the `identity` block must be set to `UserAssigned` and `identity_ids` must be set."
645645
}
646646
precondition {
647-
condition = var.enable_auto_scaling != true || var.agents_type == "VirtualMachineScaleSets"
647+
condition = var.auto_scaling_enabled != true || var.agents_type == "VirtualMachineScaleSets"
648648
error_message = "Autoscaling on default node pools is only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets type nodes."
649649
}
650650
precondition {

variables.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable "agents_availability_zones" {
3535
variable "agents_count" {
3636
type = number
3737
default = 2
38-
description = "The number of Agents that should exist in the Agent Pool. Please set `agents_count` `null` while `enable_auto_scaling` is `true` to avoid possible `agents_count` changes."
38+
description = "The number of Agents that should exist in the Agent Pool. Please set `agents_count` `null` while `auto_scaling_enabled` is `true` to avoid possible `agents_count` changes."
3939
}
4040

4141
variable "agents_labels" {
@@ -503,19 +503,19 @@ variable "ebpf_data_plane" {
503503
description = "(Optional) Specifies the eBPF data plane used for building the Kubernetes network. Possible value is `cilium`. Changing this forces a new resource to be created."
504504
}
505505

506-
variable "enable_auto_scaling" {
506+
variable "auto_scaling_enabled" {
507507
type = bool
508508
default = false
509509
description = "Enable node pool autoscaling"
510510
}
511511

512-
variable "enable_host_encryption" {
512+
variable "host_encryption_enabled" {
513513
type = bool
514514
default = false
515515
description = "Enable Host Encryption for default node pool. Encryption at host feature must be enabled on the subscription: https://docs.microsoft.com/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli"
516516
}
517517

518-
variable "enable_node_public_ip" {
518+
variable "node_public_ip_enabled" {
519519
type = bool
520520
default = false
521521
description = "(Optional) Should nodes in this Node Pool have a Public IP Address? Defaults to false."
@@ -1058,9 +1058,9 @@ variable "node_pools" {
10581058
host_group_id = optional(string)
10591059
capacity_reservation_group_id = optional(string)
10601060
custom_ca_trust_enabled = optional(bool)
1061-
enable_auto_scaling = optional(bool)
1062-
enable_host_encryption = optional(bool)
1063-
enable_node_public_ip = optional(bool)
1061+
auto_scaling_enabled = optional(bool)
1062+
host_encryption_enabled = optional(bool)
1063+
node_public_ip_enabled = optional(bool)
10641064
eviction_policy = optional(string)
10651065
gpu_instance = optional(string)
10661066
kubelet_config = optional(object({
@@ -1171,9 +1171,9 @@ variable "node_pools" {
11711171
host_group_id = (Optional) The fully qualified resource ID of the Dedicated Host Group to provision virtual machines from. Changing this forces a new resource to be created.
11721172
capacity_reservation_group_id = (Optional) Specifies the ID of the Capacity Reservation Group where this Node Pool should exist. Changing this forces a new resource to be created.
11731173
custom_ca_trust_enabled = (Optional) Specifies whether to trust a Custom CA. This requires that the Preview Feature `Microsoft.ContainerService/CustomCATrustPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) for more information.
1174-
enable_auto_scaling = (Optional) Whether to enable [auto-scaler](https://docs.microsoft.com/azure/aks/cluster-autoscaler).
1175-
enable_host_encryption = (Optional) Should the nodes in this Node Pool have host encryption enabled? Changing this forces a new resource to be created.
1176-
enable_node_public_ip = (Optional) Should each node have a Public IP Address? Changing this forces a new resource to be created.
1174+
auto_scaling_enabled = (Optional) Whether to enable [auto-scaler](https://docs.microsoft.com/azure/aks/cluster-autoscaler).
1175+
host_encryption_enabled = (Optional) Should the nodes in this Node Pool have host encryption enabled? Changing this forces a new resource to be created.
1176+
node_public_ip_enabled = (Optional) Should each node have a Public IP Address? Changing this forces a new resource to be created.
11771177
eviction_policy = (Optional) The Eviction Policy which should be used for Virtual Machines within the Virtual Machine Scale Set powering this Node Pool. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. An Eviction Policy can only be configured when `priority` is set to `Spot` and will default to `Delete` unless otherwise specified.
11781178
gpu_instance = (Optional) Specifies the GPU MIG instance profile for supported GPU VM SKU. The allowed values are `MIG1g`, `MIG2g`, `MIG3g`, `MIG4g` and `MIG7g`. Changing this forces a new resource to be created.
11791179
kubelet_config = optional(object({
@@ -1241,7 +1241,7 @@ variable "node_pools" {
12411241
}))
12421242
}))
12431243
node_labels = (Optional) A map of Kubernetes labels which should be applied to nodes in this Node Pool.
1244-
node_public_ip_prefix_id = (Optional) Resource ID for the Public IP Addresses Prefix for the nodes in this Node Pool. `enable_node_public_ip` should be `true`. Changing this forces a new resource to be created.
1244+
node_public_ip_prefix_id = (Optional) Resource ID for the Public IP Addresses Prefix for the nodes in this Node Pool. `node_public_ip_enabled` should be `true`. Changing this forces a new resource to be created.
12451245
node_taints = (Optional) A list of Kubernetes taints which should be applied to nodes in the agent pool (e.g `key=value:NoSchedule`). Changing this forces a new resource to be created.
12461246
orchestrator_version = (Optional) Version of Kubernetes used for the Agents. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as `1.22` are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in [the documentation](https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version). This version must be supported by the Kubernetes Cluster - as such the version of Kubernetes used on the Cluster/Control Plane may need to be upgraded first.
12471247
os_disk_size_gb = (Optional) The Agent Operating System disk size in GB. Changing this forces a new resource to be created.

0 commit comments

Comments
 (0)