Medium1 markMultiple Choice

GCP ACE · Question 42 · Domain 5.1: Managing Identity and Access Management (IAM)

You want to see a list of all users, groups, and service accounts that have been granted the roles/storage.objectAdmin role in your current project.

Which gcloud command should you use?

Answer options:

A.

gcloud iam roles list

B.

gcloud projects get-iam-policy [PROJECT_ID]

C.

gcloud auth list

D.

gcloud iam service-accounts list

How to approach this question

Recall how to view IAM bindings at the project level.

Full Answer

B.gcloud projects get-iam-policy [PROJECT_ID]✓ Correct
gcloud projects get-iam-policy [PROJECT_ID]
The IAM policy contains the bindings that associate members (users, groups, service accounts) with roles. To view who has what role at the project level, you use `gcloud projects get-iam-policy [PROJECT_ID]`. You can then grep or filter the output for the specific role.

Common mistakes

Using `gcloud iam roles list`, which only shows the definition of roles, not the assignments.

Practice the full GCP Associate Cloud Engineer Practice Exam 4

50 questions · hints · full answers · grading

More questions from this exam