Repository navigation
feat(azure): add optional zone-redundant NAT Gateway and Public IP - #151
Open
Git-PrinceNagar wants to merge 2 commits into
Open
Git-PrinceNagar wants to merge 2 commits into
Git-PrinceNagar wants to merge 2 commits into
Conversation
added 2 commits
November 11, 2026 08:24
…p 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
…tHub and Azure DevOps bootstraps Refs Azure/Azure-Landing-Zones#4072
Qi Zhang (Zhangqi910)
requested a review
from Akshay Rohilla (akshayrohilla)
November 18, 2026 12:45
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview/Summary
Adds an opt-in input,
nat_gateway_zone_redundancy_enabled(defaultfalse), that deploys the bootstrap NAT Gateway and its Public IP as zone-redundantStandardV2resources.Refs Azure/Azure-Landing-Zones#4072
The NAT Gateway and Public IP are created as
StandardSKU with no zones, so they show as non-compliant against the "Resources should be Zone Resilient" policies. AStandardNAT Gateway can only be zonal or non-zonal; zone redundancy needs aStandardV2NAT Gateway with aStandardV2Public IP.This PR fixes/adds/changes/removes
nat_gateway_zone_redundancy_enabled(bool, defaultfalse) tomodules/azure,alz/githubandalz/azuredevops.alz/localis unchanged: it setsuse_self_hosted_agents = false, so it never creates the NAT Gateway.true:azurerm_nat_gateway.alzusessku_name = "StandardV2"with nozones(the provider requireszonesto be omitted forStandardV2), andazurerm_public_ip.alzusessku = "StandardV2"withzonesset to the region's zones (local.bootstrap_location_zones,nullwhen the region has none).azurermconstraint from~> 4.20to~> 4.67inmodules/azureand the three root modules. 4.67.0 is the first 4.x release that supportsStandardV2onazurerm_nat_gatewayandazurerm_public_ip.Deliberately not changed:
false. Enabling the input replaces the NAT Gateway and Public IP (see below), so turning it on for everyone would do that on every upgrade.Standardoption. A zonal NAT Gateway does not survive a zone outage, and the preview "NAT gateway should be Zone Aligned" policy is the only thing that would favour it.StandardV2; Azure returns the error at apply, as with the other zone inputs. The variable description says so.Breaking Changes
azurermprovider floor is now~> 4.67. A working folder whose lock file pins an older 4.x needsterraform init -upgrade.Deploy-Accelerator -upgradestarts a new version folder and copies onlyterraform.tfstate, soterraform initresolves the newest 4.x there.StandardV2NAT Gateway is not available in Canada East, India South Central, Sweden South and West India. Leave the inputfalsethere.Testing Evidence
Unit tests with mocked providers (
terraform testinmodules/azure; the test file is not part of this PR, the repo has noterraform testsuite):terraform fmt -check -recursiveandterraform validatepass foralz/github,alz/azuredevopsandalz/local.Live Azure,
centralindia, isolated subscription, everything destroyed afterwards.modules/azureat v7.3.2 was applied with private networking and self-hosted agents, then this branch was applied over that state. An ACI container in the delegated subnet reports its egress IP every 20 seconds.trueStandardStandardV2Standard/ noneStandardV2/["2","3","1"]true: the plan replaced only the NAT Gateway, the Public IP and the two associations (-/+x4). The re-plan after the apply showed no further changes.StandardV2NAT Gateway has none in its configuration, so it stays flagged. This is a gap in the built-in policy, not something this PR changes.StandardV2, and a fullDeploy-Acceleratorrun against GitHub or Azure DevOps. The live run usedmodules/azure, which both roots call; the roots only pass the input through (terraform validatepasses).network_rule_bypass_for_tasks_enabled = true -> falseon the container registry, with and without this PR. That is theazapi_update_resource/azurerm_container_registryconflict fix: use native azurerm attribute for ACR task network bypass #142 fixes.As part of this Pull Request I have
Refs Azure/Azure-Landing-Zones#4072; the issue is tracked in that repository.mainbranchvariables.tf; the accelerator docs page for the bootstrap networking options is not updated in this PR.#142 also edits the
azurermconstraint inmodules/azure/terraform.tf; whichever of the two merges second needs a small rebase.