Medium1 markMultiple Choice
GCP ACE · Question 44 · Domain 5.1: Managing Identity and Access Management (IAM)
You need to audit the IAM policies for a project named 'finance-prod-123'. You want to see a list of all users and the roles they have been granted in this project using the Cloud SDK.
Which TWO commands could you use to view this information? (Select TWO)
You need to audit the IAM policies for a project named 'finance-prod-123'. You want to see a list of all users and the roles they have been granted in this project using the Cloud SDK.
Which TWO commands could you use to view this information? (Select TWO)
Answer options:
A.
gcloud iam roles list --project=finance-prod-123
B.
gcloud projects get-iam-policy finance-prod-123
C.
gcloud projects get-iam-policy finance-prod-123 --format=json
D.
gcloud compute project-info describe finance-prod-123
E.
gcloud auth list
How to approach this question
Identify the command used to retrieve IAM bindings for a project.
Full Answer
gcloud projects get-iam-policy finance-prod-123, gcloud projects get-iam-policy finance-prod-123 --format=json
The `gcloud projects get-iam-policy [PROJECT_ID]` command is used to fetch the IAM policy associated with a project. The policy contains the bindings, which show which members (users, groups, service accounts) are granted which roles. You can append `--format=json` to output the data in a machine-readable format.
Common mistakes
Choosing `gcloud iam roles list`, which only shows the definitions of roles, not who is actually assigned to them.
Practice the full GCP Associate Cloud Engineer Practice Exam 7
50 questions · hints · full answers · grading
More questions from this exam
Q01You are starting a new initiative and need to create a new Google Cloud project using the Cloud S...EasyQ02Your company is migrating to Google Cloud and wants to manage user identities centrally. They cur...MediumQ03You have just created a new Google Cloud project and want to deploy a containerized application u...MediumQ04Your finance team wants to perform complex SQL queries on your Google Cloud billing data to analy...MediumQ05You are managing a development project in Google Cloud. You want to ensure that you are notified ...Easy
Expert