Skip to content

Commit

Permalink
fix: empty project_id to google_project data source
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
  • Loading branch information
afiune committed Nov 14, 2022
1 parent 6456f16 commit af4e0ff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
resource_level = var.org_integration ? "ORGANIZATION" : "PROJECT"
resource_id = var.org_integration ? var.organization_id : module.lacework_cfg_svc_account.project_id
project_id = data.google_project.selected.project_id
project_id = length(var.project_id) > 0 ? var.project_id : data.google_project.selected.project_id

exclude_folders = length(var.folders_to_exclude) != 0
explicit_folders = length(var.folders_to_include) != 0
Expand Down Expand Up @@ -92,9 +92,7 @@ resource "random_id" "uniq" {
byte_length = 4
}

data "google_project" "selected" {
project_id = var.project_id
}
data "google_project" "selected" {}

module "lacework_cfg_svc_account" {
source = "lacework/service-account/gcp"
Expand Down

0 comments on commit af4e0ff

Please sign in to comment.