Skip to content

[Bug] Implement pre-flight validation for Project ID length #51

@aghassemlouei

Description

@aghassemlouei

Bug Description

Project creations fail mid-deployment with an Error 400 if the user supplies a Project ID longer than 30 characters.

Environment and Deployment Context

Please provide details about your deployment to help us reproduce the issue.

  • Stellar Engine Version/Commit: main
  • Deployment Type:
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Medium
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • All / General
  • FAST Stage (if applicable):
    • Stage 0 (Bootstrap)
    • Stage 1 (Resource Management)
    • Stage 2 (Network Creation)
    • Stage 3 (Security and Audit)
  • Affected Component: fast/assets/schemas/project.schema.yaml
  • Terraform Version: 1.5.7
  • GCP Provider Version: 5.10.0

Steps to Reproduce

Steps to reproduce the behavior:

  1. Provide a Project ID exceeding 30 characters in the terraform.tfvars file.
  2. Run terraform apply.
  3. See error googleapi: Error 400: field [project_id] has issue.

Expected Behavior

The Terraform plan should fail cleanly before any API calls are made, warning the user about the length constraint.

Actual Behavior

The Terraform apply executes and fails midway through the deployment, potentially leaving the state file dirty.

Relevant Logs and Errors

Error: error creating project proj-bu2-p-sample-floating-5x0i
googleapi: Error 400: field [project_id] has issue [project_id must be at most 30 characters long]

Additional Context

Adding a native Terraform validation block (condition = length(var.project_id) <= 30) to the project variables will resolve this. This was explicitly requested in the legacy Feature Braindump from 2023.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions