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)

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