Skip to content

Commit

Permalink
Merge pull request #59 from GSA-TTS/add-space-role-outputs
Browse files Browse the repository at this point in the history
Include space role ids in output
  • Loading branch information
rahearn authored Dec 19, 2024
2 parents ff5d822 + 63c7f16 commit d3849d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cg_space/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ output "space_name" {
output "space" {
value = cloudfoundry_space.space
}

output "developer_role_ids" {
value = { for username in local.developer_names : username => cloudfoundry_space_role.developers[username].id }
}

output "manager_role_ids" {
value = { for username in local.manager_names : username => cloudfoundry_space_role.managers[username].id }
}
15 changes: 15 additions & 0 deletions cg_space/tests/creation.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,19 @@ run "test_deployer_permissions" {
condition = keys(cloudfoundry_space_role.developers) == ["[email protected]", "[email protected]"]
error_message = "Should set Space Developers to var.developers + var.deployers"
}

assert {
condition = output.developer_role_ids == {
"[email protected]" = cloudfoundry_space_role.developers["[email protected]"].id,
"[email protected]" = cloudfoundry_space_role.developers["[email protected]"].id
}
error_message = "Output includes the developer role ids"
}

assert {
condition = output.manager_role_ids == {
"[email protected]" = cloudfoundry_space_role.managers["[email protected]"].id
}
error_message = "Output includes the manager role ids"
}
}

0 comments on commit d3849d6

Please sign in to comment.