Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include space role ids in output #59

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
Loading