Skip to content

Commit b199040

Browse files
committed
BREAKING CHANGE: (PSKD-348) Update tool versions to latest
1 parent dcf9250 commit b199040

18 files changed

+92
-140
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG TERRAFORM_VERSION=1.8.2
2-
ARG AZURECLI_VERSION=2.59.0
1+
ARG TERRAFORM_VERSION=1.9.5
2+
ARG AZURECLI_VERSION=2.64.0
33

44
FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform
55
FROM mcr.microsoft.com/azure-cli:$AZURECLI_VERSION

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ This project supports two options for running Terraform scripts:
5757
Access to an **Azure Subscription** and an [**Identity**](./docs/user/TerraformAzureAuthentication.md) with the *Contributor* role are required.
5858

5959
#### Terraform Requirements:
60-
- [Terraform](https://www.terraform.io/downloads.html) - v1.8.2
60+
- [Terraform](https://www.terraform.io/downloads.html) - v1.9.6
6161
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.29.7
6262
- [jq](https://stedolan.github.io/jq/) - v1.6
63-
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.59.0
63+
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.64.0
6464

6565
#### Docker Requirements:
6666
- [Docker](https://docs.docker.com/get-docker/)

container-structure-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ commandTests:
1717
- name: "terraform version"
1818
command: "terraform"
1919
args: ["--version"]
20-
expectedOutput: ["Terraform v1.8.2"]
20+
expectedOutput: ["Terraform v1.9.6"]
2121
- name: "python version"
2222
command: "python3"
2323
args: ["--version"]
@@ -29,7 +29,7 @@ commandTests:
2929
- -c
3030
- |
3131
az version -o tsv
32-
expectedOutput: ["2.59.0\t2.59.0\t1.1.0"]
32+
expectedOutput: ["2.64.0\t2.64.0\t1.1.0"]
3333

3434
metadataTest:
3535
workdir: "/viya4-iac-azure"

docs/CONFIG-VARS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ The default values for the `subnets` variable are as follows:
127127
aks = {
128128
"prefixes": ["192.168.0.0/23"],
129129
"service_endpoints": ["Microsoft.Sql"],
130-
"private_endpoint_network_policies_enabled": false,
130+
"private_endpoint_network_policies": "Disabled",
131131
"private_link_service_network_policies_enabled": false,
132132
"service_delegations": {},
133133
}
134134
misc = {
135135
"prefixes": ["192.168.2.0/24"],
136136
"service_endpoints": ["Microsoft.Sql"],
137-
"private_endpoint_network_policies_enabled": false,
137+
"private_endpoint_network_policies": "Disabled",
138138
"private_link_service_network_policies_enabled": false,
139139
"service_delegations": {},
140140
}
141141
## If using ha storage then the following is also added
142142
netapp = {
143143
"prefixes": ["192.168.3.0/24"],
144144
"service_endpoints": [],
145-
"private_endpoint_network_policies_enabled": false,
145+
"private_endpoint_network_policies": "Disabled",
146146
"private_link_service_network_policies_enabled": false,
147147
"service_delegations": {
148148
netapp = {

examples/sample-input-postgres.tfvars

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ postgres_servers = {
4343
# aks = {
4444
# "prefixes" : ["192.168.0.0/23"],
4545
# "service_endpoints" : ["Microsoft.Sql"],
46-
# "private_endpoint_network_policies_enabled" : true,
46+
# "private_endpoint_network_policies" : "Enabled",
4747
# "private_link_service_network_policies_enabled" : false,
4848
# "service_delegations" : {},
4949
# }
5050
# misc = {
5151
# "prefixes" : ["192.168.2.0/24"],
5252
# "service_endpoints" : ["Microsoft.Sql"],
53-
# "private_endpoint_network_policies_enabled" : true,
53+
# "private_endpoint_network_policies" : "Enabled",
5454
# "private_link_service_network_policies_enabled" : false,
5555
# "service_delegations" : {},
5656
# }
5757
# netapp = {
5858
# "prefixes" : ["192.168.3.0/24"],
5959
# "service_endpoints" : [],
60-
# "private_endpoint_network_policies_enabled" : false,
60+
# "private_endpoint_network_policies" : "Disabled",
6161
# "private_link_service_network_policies_enabled" : false,
6262
# "service_delegations" : {
6363
# netapp = {
@@ -69,7 +69,7 @@ postgres_servers = {
6969
# postgresql = {
7070
# "prefixes": ["192.168.4.0/24"],
7171
# "service_endpoints": ["Microsoft.Sql"],
72-
# "private_endpoint_network_policies_enabled": true,
72+
# "private_endpoint_network_policies": "Enabled",
7373
# "private_link_service_network_policies_enabled": false,
7474
# "service_delegations": {
7575
# flexpostgres = {

examples/sample-input-singlestore.tfvars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,22 @@ subnets = {
133133
aks = {
134134
"prefixes": ["192.168.0.0/21"],
135135
"service_endpoints": ["Microsoft.Sql"],
136-
"private_endpoint_network_policies_enabled": false,
136+
"private_endpoint_network_policies": "Disabled",
137137
"private_link_service_network_policies_enabled": false,
138138
"service_delegations": {},
139139
}
140140
misc = {
141141
"prefixes": ["192.168.8.0/24"],
142142
"service_endpoints": ["Microsoft.Sql"],
143-
"private_endpoint_network_policies_enabled": false,
143+
"private_endpoint_network_policies": "Disabled",
144144
"private_link_service_network_policies_enabled": false,
145145
"service_delegations": {},
146146
}
147147
## If using ha storage then the following is also added
148148
netapp = {
149149
"prefixes": ["192.168.9.0/24"],
150150
"service_endpoints": [],
151-
"private_endpoint_network_policies_enabled": false,
151+
"private_endpoint_network_policies": "Disabled",
152152
"private_link_service_network_policies_enabled": false,
153153
"service_delegations": {
154154
netapp = {

main.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ module "aks" {
144144
aks_cluster_max_pods = var.default_nodepool_max_pods
145145
aks_cluster_os_disk_size = var.default_nodepool_os_disk_size
146146
aks_cluster_node_vm_size = var.default_nodepool_vm_type
147-
aks_cluster_enable_host_encryption = var.aks_cluster_enable_host_encryption
147+
aks_cluster_host_encryption_enabled = var.aks_cluster_host_encryption_enabled
148148
aks_node_disk_encryption_set_id = var.aks_node_disk_encryption_set_id
149149
aks_cluster_node_admin = var.node_vm_admin
150150
aks_cluster_ssh_public_key = try(file(var.ssh_public_key), "")
@@ -159,7 +159,6 @@ module "aks" {
159159
aks_network_policy = var.aks_network_policy
160160
aks_network_plugin_mode = var.aks_network_plugin_mode
161161
aks_dns_service_ip = var.aks_dns_service_ip
162-
aks_docker_bridge_cidr = var.aks_docker_bridge_cidr
163162
cluster_egress_type = local.cluster_egress_type
164163
aks_pod_cidr = var.aks_pod_cidr
165164
aks_service_cidr = var.aks_service_cidr
@@ -202,7 +201,7 @@ module "node_pools" {
202201
os_disk_size = each.value.os_disk_size
203202
# TODO: enable with azurerm v2.37.0
204203
# os_disk_type = each.value.os_disk_type
205-
enable_auto_scaling = each.value.min_nodes == each.value.max_nodes ? false : true
204+
auto_scaling_enabled = each.value.min_nodes == each.value.max_nodes ? false : true
206205
node_count = each.value.min_nodes
207206
min_nodes = each.value.min_nodes == each.value.max_nodes ? null : each.value.min_nodes
208207
max_nodes = each.value.min_nodes == each.value.max_nodes ? null : each.value.max_nodes
@@ -212,7 +211,7 @@ module "node_pools" {
212211
zones = (var.node_pools_availability_zone == "" || var.node_pools_proximity_placement == true) ? [] : (var.node_pools_availability_zones != null) ? var.node_pools_availability_zones : [var.node_pools_availability_zone]
213212
proximity_placement_group_id = element(coalescelist(azurerm_proximity_placement_group.proximity[*].id, [""]), 0)
214213
orchestrator_version = var.kubernetes_version
215-
enable_host_encryption = var.aks_cluster_enable_host_encryption
214+
host_encryption_enabled = var.aks_cluster_host_encryption_enabled
216215
tags = var.tags
217216
}
218217

modules/aks_node_pool/main.tf

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,50 @@
44
# Reference: https://www.terraform.io/docs/providers/azurerm/r/kubernetes_cluster_node_pool.html
55

66
resource "azurerm_kubernetes_cluster_node_pool" "autoscale_node_pool" {
7-
count = var.enable_auto_scaling ? 1 : 0
7+
count = var.auto_scaling_enabled ? 1 : 0
88
name = var.node_pool_name
99
kubernetes_cluster_id = var.aks_cluster_id
1010
vnet_subnet_id = var.vnet_subnet_id
1111
zones = var.zones
1212
fips_enabled = var.fips_enabled
13-
enable_host_encryption = var.enable_host_encryption
13+
host_encryption_enabled = var.host_encryption_enabled
1414
proximity_placement_group_id = var.proximity_placement_group_id == "" ? null : var.proximity_placement_group_id
1515
vm_size = var.machine_type
1616
os_disk_size_gb = var.os_disk_size
1717
# TODO: enable after azurerm v2.37.0
1818
# os_disk_type = var.os_disk_type
19-
os_type = var.os_type
20-
enable_auto_scaling = var.enable_auto_scaling
21-
# Still in preview, revisit if needed later - https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools-preview
22-
# enable_node_public_ip = var.enable_node_public_ip
23-
node_count = var.node_count
24-
max_count = var.max_nodes
25-
min_count = var.min_nodes
26-
max_pods = var.max_pods
27-
node_labels = var.node_labels
28-
node_taints = var.node_taints
29-
orchestrator_version = var.orchestrator_version
30-
tags = var.tags
19+
os_type = var.os_type
20+
auto_scaling_enabled = var.auto_scaling_enabled
21+
node_public_ip_enabled = var.node_public_ip_enabled
22+
node_count = var.node_count
23+
max_count = var.max_nodes
24+
min_count = var.min_nodes
25+
max_pods = var.max_pods
26+
node_labels = var.node_labels
27+
node_taints = var.node_taints
28+
orchestrator_version = var.orchestrator_version
29+
tags = var.tags
3130

3231
lifecycle {
3332
ignore_changes = [node_count]
3433
}
3534
}
3635

3736
resource "azurerm_kubernetes_cluster_node_pool" "static_node_pool" {
38-
count = var.enable_auto_scaling ? 0 : 1
37+
count = var.auto_scaling_enabled ? 0 : 1
3938
name = var.node_pool_name
4039
kubernetes_cluster_id = var.aks_cluster_id
4140
vnet_subnet_id = var.vnet_subnet_id
4241
zones = var.zones
4342
fips_enabled = var.fips_enabled
44-
enable_host_encryption = var.enable_host_encryption
43+
host_encryption_enabled = var.host_encryption_enabled
4544
proximity_placement_group_id = var.proximity_placement_group_id == "" ? null : var.proximity_placement_group_id
4645
vm_size = var.machine_type
4746
os_disk_size_gb = var.os_disk_size
4847
# TODO: enable after azurerm v2.37.0
4948
# os_disk_type = var.os_disk_type
5049
os_type = var.os_type
51-
enable_auto_scaling = var.enable_auto_scaling
50+
auto_scaling_enabled = var.auto_scaling_enabled
5251
node_count = var.node_count
5352
max_count = var.max_nodes
5453
min_count = var.min_nodes

modules/aks_node_pool/variables.tf

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ variable "fips_enabled" {
2323
default = false
2424
}
2525

26-
variable "enable_host_encryption" {
26+
variable "host_encryption_enabled" {
2727
description = "Enables host encryption on all the nodes in the Node Pool. Changing this forces a new resource to be created."
2828
type = bool
2929
default = false
@@ -65,12 +65,18 @@ variable "node_count" {
6565
default = 1
6666
}
6767

68-
variable "enable_auto_scaling" {
68+
variable "auto_scaling_enabled" {
6969
description = "Whether to enable auto-scaler."
7070
type = bool
7171
default = false
7272
}
7373

74+
variable "node_public_ip_enabled" {
75+
description = "Should nodes in this Node Pool have a Public IP Address"
76+
type = bool
77+
default = false
78+
}
79+
7480
variable "max_pods" {
7581
description = "The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
7682
type = number
@@ -116,23 +122,3 @@ variable "proximity_placement_group_id" {
116122
type = string
117123
default = ""
118124
}
119-
120-
# For future - https://docs.microsoft.com/en-us/azure/aks/spot-node-pool
121-
#
122-
# variable "priority" {
123-
# description = "The Priority for Virtual Machines within the Virtual Machine Scale Set that powers this Node Pool. Possible values are Regular and Spot. Defaults to Regular. Changing this forces a new resource to be created."
124-
# type = string
125-
# default = "Regular"
126-
# }
127-
128-
# variable "eviction_policy" {
129-
# description = "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"
130-
# type = string
131-
# default = null
132-
# }
133-
134-
# variable "spot_max_price" {
135-
# description = "The maximum price you're willing to pay in USD per Virtual Machine. Valid values are -1 (the current on-demand price for a Virtual Machine) or a positive value with up to five decimal places. Changing this forces a new resource to be created."
136-
# type = number
137-
# default = -1
138-
# }

modules/azure_aks/main.tf

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ resource "azurerm_kubernetes_cluster" "aks" {
1717

1818
# https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions
1919
# az aks get-versions --location eastus -o table
20-
kubernetes_version = var.kubernetes_version
21-
api_server_authorized_ip_ranges = var.aks_cluster_endpoint_public_access_cidrs
22-
private_cluster_enabled = var.aks_private_cluster
23-
private_dns_zone_id = var.aks_private_cluster && var.aks_cluster_private_dns_zone_id != "" ? var.aks_cluster_private_dns_zone_id : (var.aks_private_cluster ? "System" : null)
20+
kubernetes_version = var.kubernetes_version
21+
private_cluster_enabled = var.aks_private_cluster
22+
private_dns_zone_id = var.aks_private_cluster && var.aks_cluster_private_dns_zone_id != "" ? var.aks_cluster_private_dns_zone_id : (var.aks_private_cluster ? "System" : null)
2423

2524
network_profile {
2625
# Docs on AKS Advanced Networking config
@@ -37,11 +36,17 @@ resource "azurerm_kubernetes_cluster" "aks" {
3736
service_cidr = var.aks_service_cidr
3837
dns_service_ip = var.aks_dns_service_ip
3938
pod_cidr = var.aks_network_plugin == "kubenet" ? var.aks_pod_cidr : null
40-
docker_bridge_cidr = var.aks_docker_bridge_cidr
4139
outbound_type = var.cluster_egress_type
4240
load_balancer_sku = "standard"
4341
}
4442

43+
dynamic "api_server_access_profile" {
44+
for_each = length(var.aks_cluster_endpoint_public_access_cidrs) > 0 ? [1] : []
45+
content {
46+
authorized_ip_ranges = var.aks_cluster_endpoint_public_access_cidrs
47+
}
48+
}
49+
4550
dynamic "linux_profile" {
4651
for_each = var.aks_cluster_ssh_public_key == "" ? [] : [1]
4752
content {
@@ -55,31 +60,29 @@ resource "azurerm_kubernetes_cluster" "aks" {
5560
dynamic "azure_active_directory_role_based_access_control" {
5661
for_each = var.rbac_aad_enabled ? [1] : []
5762
content {
58-
managed = true
59-
tenant_id = var.rbac_aad_tenant_id
60-
admin_group_object_ids = var.rbac_aad_admin_group_object_ids
61-
azure_rbac_enabled = false
63+
tenant_id = var.rbac_aad_tenant_id
64+
admin_group_object_ids = var.rbac_aad_admin_group_object_ids
65+
azure_rbac_enabled = false
6266
}
6367
}
6468

6569
default_node_pool {
66-
name = "system"
67-
vm_size = var.aks_cluster_node_vm_size
68-
zones = var.aks_availability_zones
69-
enable_auto_scaling = var.aks_cluster_node_auto_scaling
70-
enable_node_public_ip = false
71-
node_labels = {}
72-
node_taints = []
73-
fips_enabled = var.fips_enabled
74-
enable_host_encryption = var.aks_cluster_enable_host_encryption
75-
max_pods = var.aks_cluster_max_pods
76-
os_disk_size_gb = var.aks_cluster_os_disk_size
77-
max_count = var.aks_cluster_max_nodes
78-
min_count = var.aks_cluster_min_nodes
79-
node_count = var.aks_cluster_node_count
80-
vnet_subnet_id = var.aks_vnet_subnet_id
81-
tags = var.aks_cluster_tags
82-
orchestrator_version = var.kubernetes_version
70+
name = "system"
71+
vm_size = var.aks_cluster_node_vm_size
72+
zones = var.aks_availability_zones
73+
auto_scaling_enabled = var.aks_cluster_node_auto_scaling
74+
node_public_ip_enabled = false
75+
node_labels = {}
76+
fips_enabled = var.fips_enabled
77+
host_encryption_enabled = var.aks_cluster_host_encryption_enabled
78+
max_pods = var.aks_cluster_max_pods
79+
os_disk_size_gb = var.aks_cluster_os_disk_size
80+
max_count = var.aks_cluster_max_nodes
81+
min_count = var.aks_cluster_min_nodes
82+
node_count = var.aks_cluster_node_count
83+
vnet_subnet_id = var.aks_vnet_subnet_id
84+
tags = var.aks_cluster_tags
85+
orchestrator_version = var.kubernetes_version
8386
}
8487

8588
dynamic "service_principal" {

0 commit comments

Comments
 (0)