Courseiva
Configuring Access and SecuritymediumMultiple ChoiceObjective-mapped

Google ACE Configuring Access and Security Practice Question

An engineer wants to view the current IAM policy for a project in JSON format. Which command should they use?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

gcloud projects get-iam-policy my-project --format json

The gcloud projects get-iam-policy command with --format json outputs the IAM policy in JSON format.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • gcloud resource-manager folders get-iam-policy my-project --format json

    Why it's wrong here

    This command is for folders, not projects. The gcloud resource-manager folders get-iam-policy subcommand expects a folder ID like '123456789012', not a project ID; passing 'my-project' would fail because folders and projects have separate namespaces. Therefore, although it uses the correct --format json flag, it targets the wrong IAM resource type and cannot return the project's policy.

  • gcloud projects describe my-project --format json

    Why it's wrong here

    The gcloud projects describe command returns project metadata, including display name, labels, lifecycle state, and parent resource, but it does not include IAM policy bindings. IAM policies are retrieved using the dedicated get-iam-policy subcommand, which is absent here. Thus this command fails to answer the engineer's need to view the current IAM policy.

  • gcloud projects get-iam-policy my-project --format json

    Why this is correct

    This is the exact, valid CLI command for retrieving a project's IAM policy. The subcommand get-iam-policy reads the IAM policy bound to the specified project resource, and --format json renders it as a JSON array of bindings, including roles, members, and conditions. It is the correct tool for this task.

  • gcloud iam policies get my-project --format json

    Why it's wrong here

    The gcloud CLI does not have a top-level 'gcloud iam policies get' command; the available gcloud iam groups include roles, service-accounts, keys, and other resources but not a generic 'policies' group. To retrieve IAM policies, you must use the resource-specific command, such as gcloud projects get-iam-policy or gcloud folders get-iam-policy. Therefore this command is nonexistent and would return an error.

About these practice questions

Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.