Skip to content

[Feature Request] Adopt the upstream Fabric naming convention for Terraform labels #309

Closed

Description

@digitalresistor

Feature Description

Adopt the Terraform label naming convention that upstream Cloud Foundation Fabric enforces, and enforce it here with tflint in CI.

  • Resource, data source, variable and output labels use snake_case, such as google_compute_firewall.allow_iap.
  • Module labels use kebab-case, such as module.core-log-metrics.
  • Local names use snake_case and may start with _ for block-private intermediate values.

Use Case

Labels mix dashes and underscores across the repository, and no document says which form to use.

  • Upstream Fabric adopted the convention in Enable terraform_naming_convention in tflint GoogleCloudPlatform/cloud-foundation-fabric#3930, released in v55.4.0. That change enables the tflint terraform_naming_convention rule and renames every old label with a moved block, so existing state migrates without recreating resources.
  • Stellar Engine synced its modules from Fabric v38.0.0, before that change, and its own stages and blueprints never followed one convention. A scan against the upstream rule finds 148 violations: 95 resource labels, 30 module labels, 20 outputs, 2 variables and 1 local.
  • Of those, 101 are in code that Stellar Engine owns: 36 in fast/stages-aw/, 58 in blueprints/, 6 in modules/organization-se/ and 1 in modules/private-service-connect/. The other 47 are in modules that track upstream, where the upstream sync in [Feature Request] Sync the modules from upstream Cloud Foundation Fabric and keep them current #308 brings Fabric's own renames.
  • Neither docs/naming-convention.md nor .gemini/styleguide.md covers Terraform labels, and CI does not run tflint, although the repository has a .tflint.hcl file.

Proposed Solution

  • Rename the labels in the code that Stellar Engine owns, with a moved block before each renamed resource or module, matching the upstream style. Plans for existing deployments then show moves instead of replacements.
  • Rename the blueprint outputs and the il5/gcs-project bucket-name variable to snake_case, and list every old and new name in an upgrade-note, because forks that read these outputs or set that variable need to update.
  • Use the upstream labels in modules/organization-se/logging.tf, so the next upstream sync merges that file cleanly.
  • Add the upstream terraform_naming_convention rule to .tflint.hcl, add a tools/tflint.sh runner, and run it in a new CI job. Until the upstream sync lands, the runner skips the modules that track upstream.
  • Document the convention in docs/naming-convention.md and .gemini/styleguide.md, including the requirement for a moved block on every rename.

Compliance & Deployment Context

  • Target Deployment Type(s):
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Moderate
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • All / General
  • Relevant NIST 800-53r5 Controls: CM-2 baseline configuration, CM-3 configuration change control

Reusability Check

Stellar Engine prioritizes reusability.

  • I have checked if this functionality can be achieved by extending an existing module or blueprint.
  • I have verified that this does not duplicate existing functionality.

Alternatives Considered

  • Keep the existing labels and document them as allowed. This leaves the repository inconsistent with upstream, so every upstream sync keeps conflicting on renamed labels.
  • Suppress the rule with tflint-ignore annotations on interface names, as upstream did for one test variable. That avoids the output and variable renames now but leaves a mixed convention in the blueprints.

Additional Context

Activity

  1. added
    Enhancement
    Priority - Medium
    Level of Effort - Medium
    Scope - Module
    Scope - Fast
    Scope - Blueprint
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementLevel of Effort - MediumPriority - MediumScope - BlueprintScope - FastScope - Module

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions