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:
@@ -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 -->
|
||||
|
||||
@@ -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" {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user