HashiCorp Cloud Platform
hcp iam groups iam add-binding
Command: hcp iam groups iam add-binding
The hcp iam groups iam add-binding
command adds an IAM policy binding for the
given group. A binding grants the specified principal the given role on the
group.
To view the available roles to bind, run hcp iam roles list
.
Currently, the only supported role on a principal in a group is
roles/iam.group-manager
.
A group manager can add/remove members from the group and update the group name/description.
Usage
$ hcp iam groups iam add-binding --group=NAME --member=PRINCIPAL_ID --role=ROLE_ID
[Optional Flags]
Examples
Bind a principal to role roles/iam.group-manager
:
$ hcp iam groups iam add-binding \
--group=Group-Name \
--member=ef938a22-09cf-4be9-b4d0-1f4587f80f53 \
--role=roles/iam.group-manager
Required flags
-g, --group=NAME
- The name of the group to add the role binding to.-m, --member=PRINCIPAL_ID
- The ID of the principal to add the role binding to.-r, --role=ROLE_ID
- The role ID (e.g. "roles/iam.group-manager") to bind the member to.