diff --git a/modules/custom_role_iam/README.md b/modules/custom_role_iam/README.md index c8bb0a68..978b44c4 100644 --- a/modules/custom_role_iam/README.md +++ b/modules/custom_role_iam/README.md @@ -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. | diff --git a/modules/custom_role_iam/outputs.tf b/modules/custom_role_iam/outputs.tf index 3981181d..4d39e686 100644 --- a/modules/custom_role_iam/outputs.tf +++ b/modules/custom_role_iam/outputs.tf @@ -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." +}