Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty project_id in google_project data source #77

Merged

Commits on Nov 14, 2022

  1. fix: empty project_id in google_project data source

    A validation change hashicorp/terraform-provider-google#12846
    was introduced in version `4.42.0` of the google provider. This
    validation makes all our GCP modules to fail with:
    ```
    │ Error: "" project_id must be 6 to 30 with lowercase letters, digits, hyphens and start with a letter. Trailing hyphens are prohibited.
    │
    │   with module.gcp_project_audit_log.data.google_project.selected,
    │   on .terraform/modules/gcp_project_audit_log/main.tf line 96, in data "google_project" "selected":
    │   96:   project_id = var.project_id
    ```
    
    To solve this issue we are avoiding using the `google_project` data
    source when we know the `project_id` that was provided by the user.
    
    If the user does not provide a `project_id`, then we use the data
    source to discover the project from the google provider.
    
    Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
    afiune committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    f01973c View commit details
    Browse the repository at this point in the history