From 6eb1af06b1143dfa14426aa9c7749b510784d771 Mon Sep 17 00:00:00 2001 From: "Prince Nagar (BEYONDSOFT CONSULTING INC)" Date: Wed, 11 Nov 2026 08:24:25 +0530 Subject: [PATCH 1/2] feat(azure): add nat_gateway_zone_redundancy_enabled for the bootstrap NAT Gateway When enabled, the NAT Gateway and its Public IP use the StandardV2 SKU and the Public IP spans the region's availability zones. Default false keeps the Standard SKU with no zones, so existing deployments plan no changes. Raises the azurerm constraint to ~> 4.67, the first 4.x release with StandardV2 support for azurerm_nat_gateway and azurerm_public_ip. Refs Azure/Azure-Landing-Zones#4072 --- alz/azuredevops/terraform.tf | 2 +- alz/github/terraform.tf | 2 +- alz/local/terraform.tf | 2 +- modules/azure/networking.tf | 5 +++-- modules/azure/terraform.tf | 2 +- modules/azure/variables.tf | 14 ++++++++++++++ 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/alz/azuredevops/terraform.tf b/alz/azuredevops/terraform.tf index ba0dc2fe..e11845ea 100644 --- a/alz/azuredevops/terraform.tf +++ b/alz/azuredevops/terraform.tf @@ -3,7 +3,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~> 4.20" + version = "~> 4.67" } azapi = { source = "azure/azapi" diff --git a/alz/github/terraform.tf b/alz/github/terraform.tf index 9b2c38ab..8e8e370b 100644 --- a/alz/github/terraform.tf +++ b/alz/github/terraform.tf @@ -3,7 +3,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~> 4.20" + version = "~> 4.67" } azapi = { source = "azure/azapi" diff --git a/alz/local/terraform.tf b/alz/local/terraform.tf index 00a4f29b..3459e20c 100644 --- a/alz/local/terraform.tf +++ b/alz/local/terraform.tf @@ -3,7 +3,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~> 4.20" + version = "~> 4.67" } azapi = { source = "azure/azapi" diff --git a/modules/azure/networking.tf b/modules/azure/networking.tf index d2b5d105..c250babd 100644 --- a/modules/azure/networking.tf +++ b/modules/azure/networking.tf @@ -12,7 +12,8 @@ resource "azurerm_public_ip" "alz" { location = var.azure_location resource_group_name = azurerm_resource_group.network[0].name allocation_method = "Static" - sku = "Standard" + sku = var.nat_gateway_zone_redundancy_enabled ? "StandardV2" : "Standard" + zones = var.nat_gateway_zone_redundancy_enabled && length(local.bootstrap_location_zones) > 0 ? local.bootstrap_location_zones : null } resource "azurerm_nat_gateway" "alz" { @@ -20,7 +21,7 @@ resource "azurerm_nat_gateway" "alz" { name = var.nat_gateway_name location = var.azure_location resource_group_name = azurerm_resource_group.network[0].name - sku_name = "Standard" + sku_name = var.nat_gateway_zone_redundancy_enabled ? "StandardV2" : "Standard" } resource "azurerm_nat_gateway_public_ip_association" "alz" { diff --git a/modules/azure/terraform.tf b/modules/azure/terraform.tf index c30ea0f0..4fdddbea 100644 --- a/modules/azure/terraform.tf +++ b/modules/azure/terraform.tf @@ -2,7 +2,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~> 4.20" + version = "~> 4.67" } azapi = { source = "azure/azapi" diff --git a/modules/azure/variables.tf b/modules/azure/variables.tf index dfbfc779..63e5767a 100644 --- a/modules/azure/variables.tf +++ b/modules/azure/variables.tf @@ -395,6 +395,20 @@ variable "nat_gateway_name" { default = "" } +variable "nat_gateway_zone_redundancy_enabled" { + description = <<-EOT + **(Optional, default: `false`)** Deploy a zone-redundant NAT Gateway and Public IP. + + When enabled, the NAT Gateway and its Public IP use the `StandardV2` SKU, and the Public IP spans the availability zones of the region. + When disabled, both use the `Standard` SKU with no availability zones. + Changing this value replaces the NAT Gateway and Public IP, which changes the outbound IP address of the agents. + Some regions do not support the `StandardV2` NAT Gateway, in which case this should be set to false. + EOT + type = bool + default = false + nullable = false +} + variable "virtual_network_subnet_name_container_instances" { description = <<-EOT **(Optional, default: `""`)** Name of the subnet delegated for Azure Container Instances. From a13944d30ccb4b7b34f6b8e9f9f5828f0cd6edbf Mon Sep 17 00:00:00 2001 From: "Prince Nagar (BEYONDSOFT CONSULTING INC)" Date: Wed, 11 Nov 2026 08:24:25 +0530 Subject: [PATCH 2/2] feat(bootstrap): expose nat_gateway_zone_redundancy_enabled in the GitHub and Azure DevOps bootstraps Refs Azure/Azure-Landing-Zones#4072 --- alz/azuredevops/main.tf | 1 + alz/azuredevops/variables.tf | 15 +++++++++++++++ alz/github/main.tf | 1 + alz/github/variables.tf | 15 +++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/alz/azuredevops/main.tf b/alz/azuredevops/main.tf index 33c0227a..be00490b 100644 --- a/alz/azuredevops/main.tf +++ b/alz/azuredevops/main.tf @@ -52,6 +52,7 @@ module "azure" { container_registry_zone_redundancy_enabled = coalesce(var.container_registry_zone_redundancy_enabled, var.agent_container_zone_support) public_ip_name = local.resource_names.public_ip nat_gateway_name = local.resource_names.nat_gateway + nat_gateway_zone_redundancy_enabled = var.nat_gateway_zone_redundancy_enabled use_self_hosted_agents = var.use_self_hosted_agents container_registry_name = local.resource_names.container_registry container_registry_private_endpoint_name = local.resource_names.container_registry_private_endpoint diff --git a/alz/azuredevops/variables.tf b/alz/azuredevops/variables.tf index b3801635..f43b1c31 100644 --- a/alz/azuredevops/variables.tf +++ b/alz/azuredevops/variables.tf @@ -440,6 +440,21 @@ variable "container_registry_zone_redundancy_enabled" { default = null } +variable "nat_gateway_zone_redundancy_enabled" { + description = <<-EOT + **(Optional, default: `false`)** Deploy a zone-redundant NAT Gateway and Public IP. + + When enabled, the NAT Gateway and its Public IP use the `StandardV2` SKU, and the Public IP spans the availability zones of the region. + When disabled, both use the `Standard` SKU with no availability zones. + Changing this value replaces the NAT Gateway and Public IP, which changes the outbound IP address of the agents. + Some regions do not support the `StandardV2` NAT Gateway, in which case this should be set to false. + Only used when `use_private_networking` and `use_self_hosted_agents` are enabled. + EOT + type = bool + default = false + nullable = false +} + variable "built_in_configuration_file_names" { description = <<-EOT **(Optional, default: `["config.yaml", "config-hub-and-spoke-vnet.yaml", "config-virtual-wan.yaml"]`)** diff --git a/alz/github/main.tf b/alz/github/main.tf index 19005b0a..abbe2512 100644 --- a/alz/github/main.tf +++ b/alz/github/main.tf @@ -53,6 +53,7 @@ module "azure" { container_registry_zone_redundancy_enabled = coalesce(var.container_registry_zone_redundancy_enabled, var.runner_container_zone_support) public_ip_name = local.resource_names.public_ip nat_gateway_name = local.resource_names.nat_gateway + nat_gateway_zone_redundancy_enabled = var.nat_gateway_zone_redundancy_enabled use_self_hosted_agents = var.use_self_hosted_runners container_registry_name = local.resource_names.container_registry container_registry_private_endpoint_name = local.resource_names.container_registry_private_endpoint diff --git a/alz/github/variables.tf b/alz/github/variables.tf index 24696c4c..6d8ca1a9 100644 --- a/alz/github/variables.tf +++ b/alz/github/variables.tf @@ -545,6 +545,21 @@ variable "container_registry_zone_redundancy_enabled" { default = null } +variable "nat_gateway_zone_redundancy_enabled" { + description = <<-EOT + **(Optional, default: `false`)** Deploy a zone-redundant NAT Gateway and Public IP. + + When enabled, the NAT Gateway and its Public IP use the `StandardV2` SKU, and the Public IP spans the availability zones of the region. + When disabled, both use the `Standard` SKU with no availability zones. + Changing this value replaces the NAT Gateway and Public IP, which changes the outbound IP address of the runners. + Some regions do not support the `StandardV2` NAT Gateway, in which case this should be set to false. + Only used when `use_private_networking` and `use_self_hosted_runners` are enabled. + EOT + type = bool + default = false + nullable = false +} + variable "runner_name_environment_variable" { description = <<-EOT **(Optional, default: `"GH_RUNNER_NAME"`)** The runner name environment variable supplied to the container.