Practice Test 1 | Google Cloud Certified Associate Cloud Engineer | Dumps | Mock Test
Your colleague has asked for help in creating an IAM role using Google Cloud CLI. Which of the following is the correct command to create an IAM role?
A. gcloud iam create role viewer-role –project whizlabs-prj –permissions “roles/viewer”
B. gcloud iam roles create viewer-role –project whizlabs-prj –permissions “roles/viewer”
C. gcloud iam roles create viewer-role –project whizlabs-prj –file=role-definition.yaml
D. gcloud project roles create –type iam viewer-role –project whizlabs-prj –file role-definition.yaml
Explanation:
Correct Answer – C
The gcloud command to create an IAM user is gcloud iam roles create viewer-role –project whizlabs-prj –file=role-definition.yaml. Hence, C is the correct answer.
Options A, B, and D are incorrect since these are not the valid gcloud commands to create an IAM role.
Reference:
https://cloud.google.com/iam/docs/creating-custom-roles#iam-custom-roles-testable-permissions-gcloud
Comments are closed, but trackbacks and pingbacks are open.