Skip to content

Commit fc4ac94

Browse files
authored
feat: add output for custom role name for use in IAM role bindings (#230)
1 parent 9b13d16 commit fc4ac94

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/custom_role_iam/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@ module "custom-roles" {
6262
| Name | Description |
6363
|------|-------------|
6464
| custom\_role\_id | ID of the custom role created. |
65+
| 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. |
6566

6667
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/custom_role_iam/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ output "custom_role_id" {
1818
value = local.custom-role-output
1919
description = "ID of the custom role created."
2020
}
21+
22+
output "custom_role_name" {
23+
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
24+
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."
25+
}

0 commit comments

Comments
 (0)