Skip to content

Commit

Permalink
use simpler fix borrowed from folders module, as issue is only on ite…
Browse files Browse the repository at this point in the history
…m removal
  • Loading branch information
ludoo committed Nov 9, 2019
1 parent 8f45a5c commit d11d11a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ output "service_accounts" {

output "emails" {
description = "Service account emails."
value = zipmap(var.names, [
for i in range(length(var.names)) : i > length(local.emails) - 1 ? "" : local.emails[i]
])
value = zipmap(var.names, slice(local.emails, 0, length(var.names)))
}

output "iam_emails" {
description = "IAM-format service account emails."
value = zipmap(var.names, [
for i in range(length(var.names)) : i > length(local.iam_emails) - 1 ? "" : local.iam_emails[i]
])
value = zipmap(var.names, slice(local.iam_emails, 0, length(var.names)))
}

output "emails_list" {
Expand All @@ -75,7 +71,8 @@ data "template_file" "keys" {
output "keys" {
description = "Map of service account keys."
sensitive = true
value = zipmap(var.names, [
for i in range(length(var.names)) : i > length(data.template_file.keys) ? "" : data.template_file.keys[i].rendered
])
value = zipmap(
var.names,
slice(data.template_file.keys[*].rendered, 0, length(var.names))
)
}

0 comments on commit d11d11a

Please sign in to comment.