Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A developer joins your organization and requires access to inspect Cloud Build operations in a Google Cloud project named corp-apps-prod. According to the principle of least privilege, the developer only needs read-only access to view build resources.
You need to assign the Cloud Build Viewer role (roles/cloudbuild.builds.viewer) to the developer's identity (dev-user@example.com) by using the Google Cloud CLI.
Which command should you run to grant this role?
gcloud projects add-member isgcloud projects add-member is not a valid Google Cloud CLI command. Google Cloud CLI structures resource-level access management around policy bindings.
gcloud projects command group does not contain an add-member command.--member rather than --principal for specifying identities in policy binding commands.add-member is unrecognized.add-iam-policy-binding or remove-iam-policy-binding commands.--member formatted with a principal prefix (e.g., user:, serviceAccount:, group:).The Google Cloud CLI utilized simplified shorthand subcommands like add-member with a --principal argument, rather than its formal *-iam-policy-binding command hierarchy.
gcloud projects set-iam-policy isThe gcloud projects set-iam-policy command is used to replace the entire IAM allow policy for a Google Cloud project using a JSON or YAML policy file that contains the complete set of bindings.
set-iam-policy command expects a policy file argument (such as a path to a JSON/YAML file) rather than individual --member and --role flags.set-iam-policy is intended to overwrite the entire policy document at once. If executed without an intact full policy definition, it can inadvertently overwrite and remove all existing project roles for other users and service accounts.get-iam-policy), modifying the file, and then re-applying it.--member and --role parameters directly on the CLI.You needed to deploy a complete, declarative IAM policy definition from a pre-configured JSON or YAML file to overwrite and standardize all project permissions simultaneously.
gcloud iam roles doesThe gcloud iam roles command group is designed specifically for managing custom IAM role definitions (such as creating, updating, copying, or deleting custom roles), not for assigning roles to principals.
add-member subcommand under gcloud iam roles.--user do not match standard Google Cloud CLI IAM binding conventions, which require --member="principal-type:identifier".gcloud iam roles create/update/describe).roles/cloudbuild.builds.viewer cannot be modified or altered using gcloud iam roles.Google Cloud bound access by modifying role objects directly, but GCP IAM attaches allow policies to container resources (organizations, folders, projects) and individual service-specific resources instead.
gcloud projects add-iam-policy-binding isThe gcloud projects add-iam-policy-binding command is the standard Google Cloud CLI command used to bind a specific Identity and Access Management (IAM) role to a principal (member) on a target project without modifying or overwriting other existing IAM bindings.
projects resource group and specifies the project ID corp-apps-prod.--member flag uses the required prefix user: combined with the user's email address (user:dev-user@example.com).--role flag correctly supplies the fully-qualified role ID roles/cloudbuild.builds.viewer.add-iam-policy-binding appends this role grant directly to the existing allow policy.user:, serviceAccount:, group:, and domain:.This approach directly grants the exact least-privilege role to the specified user on the designated project with a single, safe CLI command, preventing accidental disruption of other existing IAM policies.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated