← IAM425 / 640
hardgcloud

Create a custom IAM role from a YAML or JSON role definition file

command

gcloud iam roles create ROLE_ID --project PROJECT_ID --file ROLE_DEFINITION_FILE

also accepted

gcloud iam roles creategcloud iam roles create ROLE_ID --file

Command breakdown

Part of the Google Cloud CLI (gcloud) — IAM category.

gcloudiamrolescreateROLE_ID--projectPROJECT_ID--fileROLE_DEFINITION_FILE
FlagPurpose
--projectBoolean flag
--fileBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →