nerdexam
Google

ASSOCIATE-CLOUD-ENGINEER · Question #86

You are working on a project named amazon-ace, and want to list all the roles assigned to users in the project. Which of the following gcloud command would you use?

The correct answer is C. gcloud projects get-iam-policy amazon-ace. To view all roles assigned to users within a specific Google Cloud project, the gcloud projects get-iam-policy command is used, specifying the project name.

Submitted by tarun92· Mar 30, 2026Configuring access and security

Question

You are working on a project named amazon-ace, and want to list all the roles assigned to users in the project. Which of the following gcloud command would you use?

Options

  • Agcloud iam list amazon-ace
  • Bgcloud projects list amazon-ace
  • Cgcloud projects get-iam-policy amazon-ace
  • Dgcloud iam get-iam-policy amazon-ace

How the community answered

(30 responses)
  • A
    3% (1)
  • C
    93% (28)
  • D
    3% (1)

Why each option

To view all roles assigned to users within a specific Google Cloud project, the `gcloud projects get-iam-policy` command is used, specifying the project name.

Agcloud iam list amazon-ace

The `gcloud iam list` command is not a valid or standard `gcloud` command for listing IAM policies on a project.

Bgcloud projects list amazon-ace

The `gcloud projects list` command lists projects themselves, not the IAM policies or roles assigned within a specific project.

Cgcloud projects get-iam-policy amazon-aceCorrect

The `gcloud projects get-iam-policy` command is designed to retrieve the IAM policy for a specified Google Cloud project, which includes all the roles assigned to users and service accounts within that project. By providing the project name `amazon-ace`, this command will output the complete IAM bindings for the project, showing who has what roles.

Dgcloud iam get-iam-policy amazon-ace

The `gcloud iam get-iam-policy` command is used to get IAM policies for resources other than projects, such as a service account or a specific resource, not directly for a project itself with this syntax; `gcloud projects get-iam-policy` is the correct project-specific command.

Concept tested: Listing project IAM policies with gcloud

Source: https://cloud.google.com/sdk/gcloud/reference/projects/get-iam-policy

Topics

#gcloud CLI#get-iam-policy#project IAM#IAM roles listing

Community Discussion

No community discussion yet for this question.

Full ASSOCIATE-CLOUD-ENGINEER Practice