HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/help/man/man1/gcloud_beta_iam_roles_copy.1
.TH "GCLOUD_BETA_IAM_ROLES_COPY" 1



.SH "NAME"
.HP
gcloud beta iam roles copy \- create a role from an existing role



.SH "SYNOPSIS"
.HP
\f5gcloud beta iam roles copy\fR [\fB\-\-dest\-organization\fR=\fIDEST_ORGANIZATION\fR] [\fB\-\-dest\-project\fR=\fIDEST_PROJECT\fR] [\fB\-\-destination\fR=\fIDESTINATION\fR] [\fB\-\-source\fR=\fISOURCE\fR] [\fB\-\-source\-organization\fR=\fISOURCE_ORGANIZATION\fR] [\fB\-\-source\-project\fR=\fISOURCE_PROJECT\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(BETA)\fR This command creates a role from an existing role.



.SH "EXAMPLES"

To create a copy of an existing role \f5\fIspanner.databaseAdmin\fR\fR into an
organization with \f5\fI1234567\fR\fR, run:

.RS 2m
$ gcloud beta iam roles copy \e
    \-\-source="roles/spanner.databaseAdmin" \e
    \-\-destination=CustomViewer \-\-dest\-organization=1234567
.RE

To create a copy of an existing role \f5\fIspanner.databaseAdmin\fR\fR into a
project with \f5\fIPROJECT_ID\fR\fR, run:

.RS 2m
$ gcloud beta iam roles copy \e
    \-\-source="roles/spanner.databaseAdmin" \e
    \-\-destination=CustomSpannerDbAdmin \-\-dest\-project=PROJECT_ID
.RE

To modify the newly created role see the roles update command.



.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-dest\-organization\fR=\fIDEST_ORGANIZATION\fR

The organization of the destination role.

.TP 2m
\fB\-\-dest\-project\fR=\fIDEST_PROJECT\fR

The project of the destination role.

.TP 2m
\fB\-\-destination\fR=\fIDESTINATION\fR

The destination role ID for the new custom role. For example: viewer.

.TP 2m
\fB\-\-source\fR=\fISOURCE\fR

The source role ID. For predefined roles, for example: roles/viewer. For custom
roles, for example: myCompanyAdmin.

.TP 2m
\fB\-\-source\-organization\fR=\fISOURCE_ORGANIZATION\fR

The organization of the source role if it is an custom role.

.TP 2m
\fB\-\-source\-project\fR=\fISOURCE_PROJECT\fR

The project of the source role if it is an custom role.


.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in beta and might change without notice. These
variants are also available:

.RS 2m
$ gcloud iam roles copy
.RE

.RS 2m
$ gcloud alpha iam roles copy
.RE