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 fdaa034 commit 2ffbe44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 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 @@ -86,9 +86,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
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
time = "~> 0.6"
lacework = {
source = "lacework/lacework"
version = "~> 0.2"
version = "~> 1.0"
}
}
}

0 comments on commit 2ffbe44

Please sign in to comment.