Add Automation Service Accounts Output (#2640)

* Add Automation Service Accounts Output

* Add Automation Service Accounts Output

* Add Projects Output, Along with Docs

* Fix output

---------

Co-authored-by: Julio Castillo <jccb@google.com>
This commit is contained in:
Joshua Wright
2024-11-17 17:29:06 +00:00
committed by GitHub
parent f9bfa04c40
commit 2676010629
4 changed files with 23 additions and 12 deletions

View File

@@ -353,5 +353,5 @@ The approach is not shown here but reasonably easy to implement. The main projec
| name | description | sensitive | consumers |
|---|---|:---:|---|
| [projects](outputs.tf#L17) | Created projects. | | |
| [service_accounts](outputs.tf#L27) | Created service accounts. | | |
| [service_accounts](outputs.tf#L22) | Created service accounts. | | |
<!-- END TFDOC -->

View File

@@ -16,12 +16,7 @@
output "projects" {
description = "Created projects."
value = {
for k, v in module.projects.projects : k => {
number = v.number
project_id = v.id
}
}
value = module.projects.projects
}
output "service_accounts" {

View File

@@ -449,8 +449,8 @@ update_rules:
| name | description | sensitive |
|---|---|:---:|
| [folders](outputs.tf#L17) | Folder ids. | |
| [projects](outputs.tf#L22) | Project module outputs. | |
| [service_accounts](outputs.tf#L27) | Service account emails. | |
| [projects](outputs.tf#L22) | Created projects. | |
| [service_accounts](outputs.tf#L43) | Service account emails. | |
<!-- END TFDOC -->
## Tests

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,24 @@ output "folders" {
}
output "projects" {
description = "Project module outputs."
value = module.projects
description = "Created projects."
value = {
for k, v in module.projects : k => {
number = v.number
project_id = v.id
project = v
automation_buckets = {
for kk, vv in module.automation-buckets :
trimprefix(kk, "${k}/") => vv.name
if startswith(kk, "${k}/")
}
automation_service_accounts = {
for kk, vv in module.automation-service-accounts :
trimprefix(kk, "${k}/") => vv.email
if startswith(kk, "${k}/")
}
}
}
}
output "service_accounts" {