Skip to content

Commit

Permalink
fix: workaround for import issue when SA is unknown (#795)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Peabody <[email protected]>
  • Loading branch information
bharathkkb and apeabody authored Mar 9, 2023
1 parent de977f5 commit 13ec49f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/core_project_factory/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ locals {
) : local.base_project_id
s_account_fmt = var.create_project_sa ? format(
"serviceAccount:%s",
google_service_account.default_service_account[0].email,
try(google_service_account.default_service_account[0].email, ""),
) : ""
api_s_account = format(
"%[email protected]",
Expand Down
10 changes: 5 additions & 5 deletions modules/core_project_factory/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@ output "project_number" {
}

output "service_account_id" {
value = var.create_project_sa ? google_service_account.default_service_account[0].account_id : ""
value = var.create_project_sa ? try(google_service_account.default_service_account[0].account_id, "") : ""
description = "The id of the default service account"
}

output "service_account_display_name" {
value = var.create_project_sa ? google_service_account.default_service_account[0].display_name : ""
value = var.create_project_sa ? try(google_service_account.default_service_account[0].display_name, "") : ""
description = "The display name of the default service account"
}

output "service_account_email" {
value = var.create_project_sa ? google_service_account.default_service_account[0].email : ""
value = var.create_project_sa ? try(google_service_account.default_service_account[0].email, "") : ""
description = "The email of the default service account"
}

output "service_account_name" {
value = var.create_project_sa ? google_service_account.default_service_account[0].name : ""
value = var.create_project_sa ? try(google_service_account.default_service_account[0].name, "") : ""
description = "The fully-qualified name of the default service account"
}

output "service_account_unique_id" {
value = var.create_project_sa ? google_service_account.default_service_account[0].unique_id : ""
value = var.create_project_sa ? try(google_service_account.default_service_account[0].unique_id, "") : ""
description = "The unique id of the default service account"
}

Expand Down

0 comments on commit 13ec49f

Please sign in to comment.