Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround for import issue when SA is unknown #795

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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