diff --git a/CHANGELOG.md b/CHANGELOG.md index ab60cc9..16b074a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to ## [Unreleased] +## [2.0.2] - 2019-10-09 + +### Fixed + +- Fix outputs on `names` variable element removal/change [#14] + ## [2.0.1] - 2019-09-13 ### Changed @@ -44,12 +50,16 @@ and this project adheres to - Initial release. [#1] -[Unreleased]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v2.0.0...HEAD +[Unreleased]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v2.0.2...HEAD +[2.0.2]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v2.0.0...v2.0.1 [2.0.0]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v1.0.0...v2.0.0 [1.0.0]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v0.1.1...v1.0.0 [0.1.1]: https://github.com/terraform-google-modules/terraform-google-service-accounts/compare/v0.1.0...v0.1.1 [0.1.0]: https://github.com/terraform-google-modules/terraform-google-service-accounts/releases/tag/v0.1.0 +[#14]: https://github.com/terraform-google-modules/terraform-google-service-accounts/pull/14 +[#13]: https://github.com/terraform-google-modules/terraform-google-service-accounts/pull/13 [#9]: https://github.com/terraform-google-modules/terraform-google-service-accounts/pull/9 [#3]: https://github.com/terraform-google-modules/terraform-google-service-accounts/pull/3 [#1]: https://github.com/terraform-google-modules/terraform-google-service-accounts/pull/1 diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..fa27914 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @morgante @aaron-lane @ludoo @averbuks diff --git a/main.tf b/main.tf index 8bbc15a..1e1f04e 100644 --- a/main.tf +++ b/main.tf @@ -19,7 +19,8 @@ locals { org_billing = var.grant_billing_role && var.billing_account_id == "" && var.org_id != "" prefix = var.prefix != "" ? "${var.prefix}-" : "" xpn = var.grant_xpn_roles && var.org_id != "" - iam_emails = [for s in google_service_account.service_accounts : "serviceAccount:${s.email}"] + emails = [for account in google_service_account.service_accounts : account.email] + iam_emails = [for email in local.emails : "serviceAccount:${email}"] } # create service accounts diff --git a/outputs.tf b/outputs.tf index b742036..70dccca 100644 --- a/outputs.tf +++ b/outputs.tf @@ -41,22 +41,22 @@ output "service_accounts" { output "emails" { description = "Service account emails." - value = zipmap(var.names, google_service_account.service_accounts[*].email) + value = zipmap(var.names, slice(local.emails, 0, length(var.names))) } output "iam_emails" { description = "IAM-format service account emails." - value = zipmap(var.names, local.iam_emails) + value = zipmap(var.names, slice(local.iam_emails, 0, length(var.names))) } output "emails_list" { description = "Service account emails." - value = google_service_account.service_accounts[*].email + value = local.emails } output "iam_emails_list" { description = "IAM-format service account emails." - value = [for s in google_service_account.service_accounts : "serviceAccount:${s.email}"] + value = local.iam_emails } data "template_file" "keys" { @@ -71,5 +71,8 @@ data "template_file" "keys" { output "keys" { description = "Map of service account keys." sensitive = true - value = zipmap(var.names, data.template_file.keys[*].rendered) + value = zipmap( + var.names, + slice(data.template_file.keys[*].rendered, 0, length(var.names)) + ) }