1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 23:42:07 +02:00
tldr/pages/common/gcloud-iam.md
Farhad Koushan 0ce0a6c094
gcloud-*: add pages (#11625)
* gcloud-*: add pages

---------

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
2024-01-08 19:29:32 +05:30

29 lines
964 B
Markdown

# gcloud iam
> Configure Identity and Access Management (IAM) preferences and service accounts.
> See also: `gcloud`.
> More information: <https://cloud.google.com/sdk/gcloud/reference/iam>.
- List IAM grantable roles for a resource:
`gcloud iam list-grantable-roles {{resource}}`
- Create a custom role for a organization or project:
`gcloud iam roles create {{role_name}} --{{organization|project}} {{organization|project_id}} --file {{path/to/role.yaml}}`
- Create a service account for a project:
`gcloud iam service-accounts create {{name}}`
- Add an IAM policy binding to a service account:
`gcloud iam service-accounts add-iam-policy-binding {{service_account_email}} --member {{member}} --role {{role}}`
- Replace existing IAM policy binding:
`gcloud iam service-accounts set-iam-policy {{service_account_email}} {{policy_file}}`
- List a service account's keys:
`gcloud iam service-accounts keys list --iam-account {{service_account_email}}`