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
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_gke_audit_log.data.google_project.selected, │ on .terraform/modules/gcp_project_gke_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>
- Loading branch information
Showing
2 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters