Repository navigation
Closed
Labels
EnhancementNew feature or requestLevel of Effort - MediumModerate task requiring thought and testing; typically takes a couple of days to a weekPriority - MediumStandard features and non-blocking bugs; important for the current milestone but not urgentScope - BlueprintRelated to solution blueprints in the blueprints directoryScope - FastRelated to Fabric FAST deployment stages in the fast directoryScope - ModuleRelated to reusable Terraform modules in the modules directory
Description
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_conventionrule and renames every old label with amovedblock, 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 inblueprints/, 6 inmodules/organization-se/and 1 inmodules/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.mdnor.gemini/styleguide.mdcovers Terraform labels, and CI does not run tflint, although the repository has a.tflint.hclfile.
Proposed Solution
- Rename the labels in the code that Stellar Engine owns, with a
movedblock 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-projectbucket-namevariable to snake_case, and list every old and new name in anupgrade-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_conventionrule to.tflint.hcl, add atools/tflint.shrunner, 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.mdand.gemini/styleguide.md, including the requirement for amovedblock 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-ignoreannotations 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
- Upstream rule and renames: Enable terraform_naming_convention in tflint GoogleCloudPlatform/cloud-foundation-fabric#3930
- Related: [Feature Request] Sync the modules from upstream Cloud Foundation Fabric and keep them current #308 syncs the shared modules from upstream Fabric.
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or requestLevel of Effort - MediumModerate task requiring thought and testing; typically takes a couple of days to a weekPriority - MediumStandard features and non-blocking bugs; important for the current milestone but not urgentScope - BlueprintRelated to solution blueprints in the blueprints directoryScope - FastRelated to Fabric FAST deployment stages in the fast directoryScope - ModuleRelated to reusable Terraform modules in the modules directory
Activity