Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: empty project_id in google_project data source (#20)
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_gar.data.google_project.selected, │ on .terraform/modules/gcp_project_gar/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> Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
- Loading branch information