feat: add outputs to module for policy names and role details
All checks were successful
development / Check commit compliance (push) Successful in 32s

This commit is contained in:
Bertrand Lanson 2024-05-25 00:32:21 +02:00
parent f51a8bf1f1
commit 79ce376b04
Signed by: lanson
SSH Key Fingerprint: SHA256:/nqc6HGqld/PS208F6FUOvZlUzTS0rGpNNwR5O2bQBw
4 changed files with 51 additions and 1 deletions

View File

@ -46,5 +46,10 @@ No modules.
### Outputs ### Outputs
No outputs. | Name | Description |
|------|-------------|
| <a name="output_extra_role_policies"></a> [extra_role_policies](#output_extra_role_policies) | The tenant extra role policy names |
| <a name="output_extra_roles"></a> [extra_roles](#output_extra_roles) | The tenant extra approle roles |
| <a name="output_tenant_admin_policy"></a> [tenant_admin_policy](#output_tenant_admin_policy) | The tenant admin policy name |
| <a name="output_tenant_admin_role"></a> [tenant_admin_role](#output_tenant_admin_role) | The tenant admin approle role |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0
examples/.gitkeep Normal file
View File

0
modules/.gitkeep Normal file
View File

View File

@ -0,0 +1,45 @@
output "tenant_admin_role" {
value = {
role_id = vault_approle_auth_backend_role.tenant_admin.role_name
secret_id = vault_approle_auth_backend_role_secret_id.tenant_admin.secret_id
}
sensitive = true
description = "The tenant admin approle role"
depends_on = [
vault_approle_auth_backend_role.tenant_admin,
vault_approle_auth_backend_role_secret_id.tenant_admin
]
}
output "tenant_admin_policy" {
value = vault_policy.tenant_admin.name
sensitive = false
description = "The tenant admin policy name"
depends_on = [vault_policy.tenant_admin]
}
output "extra_roles" {
value = {
for key, role in vault_approle_auth_backend_role.extra_roles :
key => {
role_id = role.role_name
secret_id = vault_approle_auth_backend_role_secret_id.extra_roles[key].secret_id
}
}
sensitive = true
description = "The tenant extra approle roles"
depends_on = [
vault_approle_auth_backend_role.extra_roles,
vault_approle_auth_backend_role_secret_id.extra_roles
]
}
output "extra_role_policies" {
value = {
for key, policy in vault_policy.extra_policies :
key => policy.name
}
sensitive = false
description = "The tenant extra role policy names"
depends_on = [vault_policy.extra_policies]
}