Skip to content

fix(2-networking): derive the IL5 NGFW landing gateway from the configured region - #301

Merged
aghassemlouei merged 3 commits into
google:mainfrom
digitalresistor:fix/il5-ngfw-region
Oct 20, 2026
Merged

aghassemlouei merged 3 commits into
google:mainfrom
digitalresistor:fix/il5-ngfw-region

Conversation

@digitalresistor

Copy link
Copy Markdown
Contributor

Description

This change lets the IL4 and IL5 networking stage deploy in any Assured Workloads IL4 or IL5 region, not only us-east4.

The bootstrap-xml object in the fast/stages-aw/2-networking-b-il5-ngfw/ngfw.tf file read the landing gateway from the hard-coded us-east4/landing-default subnet key. In any other region, the lookup failed at plan time. Google lists IL4 and IL5 support for us-central1, us-east1, us-east4, us-west1, us-west2, us-west3, us-west4 and the us multi-region.

  • The landing gateway lookup now uses the bootstrap region each.value as its key, which matches how the NGFW instance templates already pick their subnets.
  • A new validation on the subnets variable requires the landing-default, dmz-default and mgmt-default subnets in every region of var.regions. The NGFW instance templates look up all three by region inside try(), so a wrong region previously failed only at apply.
  • A second validation, copied from the FedRAMP stage, requires the first tenant subnet of each environment to be in regions.primary. The bootstrap.xml tenant routes and the stage outputs already index that subnet.
  • Both Stage 2 terraform.tfvars.sample files previously set every subnet to us-central1, while Stage 0 defaults regions.primary to us-east4. The samples now use the <region> placeholder that the Stage 0 and Stage 1 samples already use, with a comment that it must match regions.primary.
  • The two stage READMEs and the Stage 2 steps in the docs/ddg.md guide now tell every operator to replace <region>.
  • The IL5 stage README no longer limits the overlay to us-east4 and us-central1, and it no longer mentions the removed regions.secondary key.
  • A guard test in the tests/tools/test_stage2_networking.py file checks that the ngfw.tf file has no literal us-east4/ subnet key, that the new validation covers all three default subnets, and that both samples use the <region> placeholder.

Neither validation breaks a working configuration. Each one rejects only inputs that already failed at plan or apply time.

No tracking issue exists for this fix.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Deployment & Compliance Impact

  • Applicable Regimes:
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Moderate
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • General / All
  • NIST 800-53r5 Controls: No control implementation changes.

Checklist

Code Quality & Reusability

  • My code adheres to the Maximize Reusability principle. I have not redefined common elements and have reused existing base configurations and modules where possible.
  • I have checked that no existing module or configuration in modules/ or fast/stages-aw/ can be leveraged for this change.
  • My code follows the established naming conventions outlined in docs/naming-convention.md.

Documentation

  • I have updated the README.md of the modified module or blueprint.
  • I have added/updated documentation for inputs (variables) and outputs.

Security

  • My change adheres to GCP security best practices and the principle of least privilege.
  • I have ensured compliance with the targeted regime (FedRAMP Moderate, FedRAMP High, IL4, IL5, etc.).

Testing

  • I have tested my changes locally.
  • I have included details of my testing in this PR.

Testing Performed

  • terraform fmt -check -recursive passes on the 2-networking-a-fedramp and 2-networking-b-il5-ngfw stages.
  • terraform init -backend=false and terraform validate pass on the 2-networking-b-il5-ngfw stage. A temporary file declared the google and google-beta billing provider aliases that the downloaded 2-networking-providers.tf file normally supplies. Without those aliases, validation fails on main too.
  • terraform plan against a scratch module with copies of the regions, envs_folders and subnets variables exercised the new validations.
    • A configuration with all subnets in us-west2 and regions.primary = "us-west2" plans with no changes.
    • A landing-default, dmz-default or mgmt-default subnet in another region fails with the new default subnet error.
    • A first tenant subnet in another region fails with the new tenant subnet error.
  • pytest -q passes, with 67 tests including the new guard test.
  • tools/tfdoc.py --replace regenerated the stage README table, and tools/check_documentation.py passes for the 2-networking-b-il5-ngfw stage.
  • These pre-existing failures also reproduce on main and are out of scope.
    • tools/check_documentation.py reports FAIL_STALE_TOC for the 2-networking-a-fedramp README.
    • tools/check_boilerplate.py fast tests flags the untouched fast/stages-aw/1-resman/branch-tenants.tf file.
  • No live apply ran.

Notes for reviewers

…e configured region

The bootstrap.xml object read the landing gateway from a hard-coded
us-east4/landing-default subnet key, so the stage failed in any other
IL4 or IL5 region. Key the lookup by the bootstrap region instead, as
the NGFW instance templates already do, and validate that subnets.landing
holds landing-default and each environment's first tenant subnet in
regions.primary.
Both stage 2 samples set every subnet to us-central1 while Stage 0
defaults regions.primary to us-east4, so copying a sample unchanged
failed the region validations. Use the <region> placeholder that the
Stage 0 and Stage 1 samples already use, and tell operators in the stage
READMEs and the DDG to replace it with regions.primary.
…t regions

Extend the subnets validation from landing-default to the landing, dmz
and mgmt default subnets, because the NGFW instance templates look up
all three by region inside try() and a wrong region otherwise fails only
at apply. Shorten both validation error messages.

Update the stage README so the <region> replacement step applies to
every operator, drop the regions.secondary reference, and stop limiting
IL4 and IL5 to us-east4 and us-central1.
@github-actions github-actions Bot added the Scope - Fast Related to Fabric FAST deployment stages in the fast directory label Oct 20, 2026

@aghassemlouei aghassemlouei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that keying lz_gateway_ip in fast/stages-aw/2-networking-b-il5-ngfw/ngfw.tf by ${each.value}/landing-default aligns bootstrap-xml with the regional instance template lookups, and that the subnets variable validations and <region> sample placeholders catch mismatched Stage 2 region settings at plan time.

@aghassemlouei
aghassemlouei merged commit 5bee8f5 into google:main Oct 20, 2026
13 checks passed
@digitalresistor
digitalresistor deleted the fix/il5-ngfw-region branch October 20, 2026 22:27
@aghassemlouei aghassemlouei added Bug Something isn't working Priority - Medium Standard features and non-blocking bugs; important for the current milestone but not urgent Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Framework - IL4 DoD Impact Level 4 (IL4) compliance regime and controls Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls Scope - Stage 2 and removed Framework - IL4 DoD Impact Level 4 (IL4) compliance regime and controls labels Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - Medium Standard features and non-blocking bugs; important for the current milestone but not urgent Scope - Fast Related to Fabric FAST deployment stages in the fast directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants