Skip to content

fix(blueprints): return the il5/gke bastion external IP - #343

Merged
Calvin-Cheng1 merged 1 commit into
google:mainfrom
digitalresistor:fix/il5-gke-bastion-ip
Oct 23, 2026
Merged

Calvin-Cheng1 merged 1 commit into
google:mainfrom
digitalresistor:fix/il5-gke-bastion-ip

Conversation

@digitalresistor

Copy link
Copy Markdown
Contributor

Description

The bastion_vm_public_ip output of the blueprints/il5/gke/ blueprint now returns the bastion VM external IP address that the modules/compute-vm/ module reports.

  • The output read module.bastion-vm.network_interfaces[0].access_config[0].nat_ip, but the modules/compute-vm/ module declares no network_interfaces output.
  • The try() wrapper hid the resulting error, so the output was always null, even for a VM with an external IP.
  • The output now reads the module's external_ip output, which already returns null when the main interface has no NAT, so the try() wrapper is gone.
  • The output description drops its parenthetical, and the tools/tfdoc.py script regenerated the README outputs table.
  • The blueprints/fedramp-high/gke path is a Git 120000 symlink to ../il5/gke, so the fix covers both blueprints.

The current blueprint configures the bastion without NAT, so deployed values stay null today. The output now reports a real address as soon as the VM gets an external IP.

Fixes #316

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: CM-8 system component inventory, because the output reports the bastion address accurately. The change modifies no control implementation.

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

The fix passes a credential-free mock plan that fails against main.

  1. terraform init -backend=false and terraform validate in the blueprints/il5/gke/ blueprint pass on this branch. Validate also passes on main, because the try() wrapper hides the missing module output.
  2. A temporary tests/verify.tftest.hcl file with mock google and google-beta providers, placeholder variables, and command = plan ran two cases.
    • One case overrides the bastion-vm module with external_ip = "203.0.113.10" and asserts that output.bastion_vm_public_ip equals that address.
    • The other case uses the unmodified module and asserts that the output is null for a VM without NAT.
  3. terraform test passes both cases on this branch. On main, the first case fails because the output is null, and the second case passes. The branch commits neither the temporary test file nor the .terraform directory and lock file.
  4. uv run python tools/check_documentation.py blueprints/il5/gke passes after the README regeneration.
  5. bash tools/lint.sh passes every check except Terraform lint, which fails only because tflint is not installed locally. The CI tflint job covers it.

The bastion_vm_public_ip output read
module.bastion-vm.network_interfaces[0].access_config[0].nat_ip, but the
compute-vm module has no network_interfaces output. The try() wrapper
discarded the resulting error, so the output was always null, even for a
VM with an external IP.

Read the module's external_ip output instead. It already returns null
when the main interface has no NAT, so no try() is needed. The output
description drops its parenthetical, and tools/tfdoc.py
regenerates the README table. The fedramp-high/gke symlink picks up the
change.

Fixes google#316.
@github-actions github-actions Bot added Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls Scope - Blueprint Related to solution blueprints in the blueprints directory labels Oct 22, 2026
@Calvin-Cheng1
Calvin-Cheng1 self-requested a review October 23, 2026 04:07
@Calvin-Cheng1
Calvin-Cheng1 merged commit 568f5a6 into google:main Oct 23, 2026
16 checks passed
@aghassemlouei aghassemlouei added Bug Something isn't working Documentation Improvements or additions to documentation 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 labels Oct 26, 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 Documentation Improvements or additions to documentation 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 - Blueprint Related to solution blueprints in the blueprints directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] il5/gke: the bastion_vm_public_ip output is always null

3 participants