← IAM205 / 640
hardgcloud

Copy an existing IAM role to create a new custom role in a destination project

command

gcloud iam roles copy --source SOURCE_ROLE --destination DEST_ROLE --dest-project PROJECT_ID

also accepted

gcloud iam roles copy

Command breakdown

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

gcloudiamrolescopy--sourceSOURCE_ROLE--destinationDEST_ROLE--dest-projectPROJECT_ID
FlagPurpose
--sourceBoolean flag
--destinationBoolean flag
--dest-projectBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →