Skip to content

Commit

Permalink
feat: add output for custom role name for use in IAM role bindings (#230
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kcyau authored Oct 22, 2024
1 parent 9b13d16 commit fc4ac94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/custom_role_iam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ module "custom-roles" {
| Name | Description |
|------|-------------|
| custom\_role\_id | ID of the custom role created. |
| custom\_role\_name | Name of the custom role created in the format {{target\_level}}/{{target\_id}}/roles/{{role\_id}}, for use as a reference in other resources such as IAM role bindings. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5 changes: 5 additions & 0 deletions modules/custom_role_iam/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ output "custom_role_id" {
value = local.custom-role-output
description = "ID of the custom role created."
}

output "custom_role_name" {
value = (var.target_level == "project") ? google_project_iam_custom_role.project-custom-role[0].name : google_organization_iam_custom_role.org-custom-role[0].name
description = "Name of the custom role created in the format {{target_level}}/{{target_id}}/roles/{{role_id}}, for use as a reference in other resources such as IAM role bindings."
}

0 comments on commit fc4ac94

Please sign in to comment.