GCP Professional Cloud Security Engineer Practice Question

A DevOps team maintains an automation script that provisions Google Cloud projects and sets up their initial IAM posture. As part of onboarding a new project, the script must create a Google Group named "proj-analytics-admins" inside the organization example.com, assign it the Project IAM role roles/owner on the new project, and ensure that rerunning the script does not create duplicate groups. Which gcloud command sequence best satisfies these requirements while remaining idempotent?

  • Use gcloud identity groups describe [email protected] --format="value(name)" || gcloud identity groups create [email protected] --organization="123456789" --display-name="Project Analytics Admins", then call gcloud projects add-iam-policy-binding PROJECT_ID --member="group:[email protected]" --role="roles/owner".

  • Execute a single gcloud resource-manager set-iam-policy command with an inline JSON policy that both creates the group and assigns roles/owner to it for the new project.

  • Run gcloud iam service-accounts create proj-analytics-admins --display-name="Project Analytics Admins" followed by gcloud projects set-iam-policy PROJECT_ID policy.json where the policy grants Owner to the new service account.

  • Invoke the Groups Settings API to create a group named [email protected] and then set the Owner role by updating the group's settings with an HTTP PATCH request.

GCP Professional Cloud Security Engineer
Configuring Access
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot