diff --git a/fast/stages/2-project-factory/README.md b/fast/stages/2-project-factory/README.md index 3942d58ee1..b7f3b98cc7 100644 --- a/fast/stages/2-project-factory/README.md +++ b/fast/stages/2-project-factory/README.md @@ -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. | | | diff --git a/fast/stages/2-project-factory/outputs.tf b/fast/stages/2-project-factory/outputs.tf index baaf390290..2c86ac9c96 100644 --- a/fast/stages/2-project-factory/outputs.tf +++ b/fast/stages/2-project-factory/outputs.tf @@ -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" { diff --git a/modules/project-factory/README.md b/modules/project-factory/README.md index 34490c1514..ddb7bba4dd 100644 --- a/modules/project-factory/README.md +++ b/modules/project-factory/README.md @@ -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. | | ## Tests diff --git a/modules/project-factory/outputs.tf b/modules/project-factory/outputs.tf index 5040e76671..a8e108327d 100644 --- a/modules/project-factory/outputs.tf +++ b/modules/project-factory/outputs.tf @@ -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" {