Courseiva

PCSE Practice Question: Configuring Access Within a Cloud Solution Environment

A developer needs to create a custom IAM role that allows only a specific set of permissions for managing Cloud SQL instances. The role should be available at the organization level. 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 iam roles create ROLE_ID --organization=ORGANIZATION_ID --file=role.yaml

Custom roles can be created at the organization level using the 'gcloud iam roles create' command with the '--organization' flag (or '--org' for short). The role is defined in a YAML file that specifies the permissions. The 'gcloud organizations add-iam-policy-binding' is used to assign roles, not create them. The 'gcloud iam service-accounts create' is for service accounts. The 'gcloud projects add-iam-policy-binding' is for project-level IAM bindings.

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 iam roles create ROLE_ID --organization=ORGANIZATION_ID --file=role.yaml

    Why this is correct

    This command creates a custom role at the organization level using a YAML file with permissions defined.

  • gcloud projects add-iam-policy-binding PROJECT_ID --member=... --role=...

    Why it's wrong here

    This adds an IAM policy binding at the project level, not create a custom role.

  • gcloud iam service-accounts create SA_NAME --display-name=...

    Why it's wrong here

    This creates a service account, not a custom role.

  • gcloud organizations add-iam-policy-binding ORGANIZATION_ID --member=... --role=...

    Why it's wrong here

    This command adds an IAM policy binding, not create a custom role.

About these practice questions

One of 960 original PCSE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 PCSE 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 PCSE exam.