You have a development project with appropriate IAM roles defined. You are creating a production project and want to have the same IAM roles on the new project, using the fewest possible steps. What should you do?
A.
Use gcloud iam roles copy and specify the production project as the destination project.
B.
Use gcloud iam roles copy and specify your organization as the destination organization.
C.
In the Google Cloud Platform Console, use the 'create role from role' functionality.
D.
In the Google Cloud Platform Console, use the 'create role' functionality and select all applicable permissions.
A could be possible if we were talking about organization in the question, But here, it's clearly specified "*project*"
"You have a development project with appropriate IAM roles defined. You are creating a production project and want to have the same IAM roles on the new project, using the fewest possible steps."
from google doc: https://cloud.google.com/sdk/gcloud/reference/iam/roles/copy
EXAMPLES
To create a copy of an existing role spanner.databaseAdmin into an organization with 1234567, run:
gcloud iam roles copy --source="roles/spanner.databaseAdmin" --destination=CustomViewer --dest-organization=1234567
To create a copy of an existing role spanner.databaseAdmin into a project with PROJECT_ID, run:
gcloud iam roles copy --source="roles/spanner.databaseAdmin" --destination=CustomSpannerDbAdmin --dest-project=PROJECT_ID
The correct answer is Option A.
To create the same IAM roles in a production project as in a development project, using the fewest possible steps, you can use the gcloud iam roles copy command and specify the production project as the destination project.
The `gcloud iam roles copy` command allows you to copy IAM roles between projects or organizations. By specifying the production project as the destination project, you can copy the IAM roles from the development project to the production project.
Option B is incorrect because specifying your organization as the destination organization will copy the IAM roles to all projects within the organization, which is not what you want.
The correct answer is A. Use gcloud iam roles copy and specify the production project as the destination project.
The gcloud iam roles copy command copies a role from one project to another. To use this command, you will need to know the name of the role that you want to copy and the name of the destination project.
For example, to copy the role roles/compute.instanceAdmin from the project my-dev-project to the project my-prod-project, you would run the following command:
gcloud iam roles copy roles/compute.instanceAdmin my-dev-project my-prod-project
This command will copy the role roles/compute.instanceAdmin to the project my-prod-project. The role will have the same permissions in the production project as it does in the development project.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
coldpar
Highly Voted 4 years, 8 months agoAgents89
Highly Voted 4 years, 6 months agoChristN
Most Recent 2 months agoBuruguduystunstugudunstuy
2 months agoYourCloudGuru
2 months agoAmolbhombe
5 months, 2 weeks agosidobill
5 months, 2 weeks agosubha.elumalai
6 months agosidobill
5 months, 2 weeks agoTavi_14
10 months, 1 week agoqubrat
10 months, 2 weeks agonudiiiir
11 months agothewalker
1 year agoBAofBK
1 year agogsmasad
1 year agoguicane
1 year, 1 month agoAcielana
1 year, 1 month agoCaptain1212
1 year, 2 months ago