Skip to content

Commit

Permalink
Remove outdated template provider
Browse files Browse the repository at this point in the history
  • Loading branch information
anasinnyk committed Jun 4, 2021
1 parent c6081e2 commit 8748a59
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ output "iam_email" {

output "key" {
description = "Service account key (for single use)."
value = data.template_file.keys[var.names[0]].rendered
value = var.generate_keys ? base64decode(google_service_account_key.keys[var.names[0]].private_key) : ""
}

output "service_accounts" {
Expand Down Expand Up @@ -64,17 +64,8 @@ output "iam_emails_list" {
value = local.iam_emails_list
}

data "template_file" "keys" {
for_each = local.names
template = "$${key}"

vars = {
key = var.generate_keys ? base64decode(google_service_account_key.keys[each.value].private_key) : ""
}
}

output "keys" {
description = "Map of service account keys."
sensitive = true
value = { for k, v in data.template_file.keys : k => v.rendered }
value = { for k, v in local.names : k => var.generate_keys ? "$${base64decode(google_service_account_key.keys[v].private_key)}" : "" }
}

0 comments on commit 8748a59

Please sign in to comment.