HashiCorp Cloud Platform
hcp projects iam add-binding
Command: hcp projects iam add-binding
The hcp projects iam add-binding
command adds an IAM policy binding for the
given project. A binding grants the specified principal the given role on the
project.
To view the available roles to bind, run hcp iam roles list
.
Usage
$ hcp projects iam add-binding --member=PRINCIPAL_ID --role=ROLE_ID [Optional
Flags]
Examples
Bind a principal to role roles/viewer
:
$ hcp projects add-binding \
--project=8647ae06-ca65-467a-b72d-edba1f908fc8 \
--member=ef938a22-09cf-4be9-b4d0-1f4587f80f53 \
--role=roles/viewer
Required flags
--member=PRINCIPAL_ID
- The ID of the principal to add the role binding to.--role=ROLE_ID
- The role ID (e.g. "roles/admin", "roles/contributor", "roles/viewer") to bind the member to.