GCP Professional Cloud Architect Practice Question
Your security operations team must regularly generate and rotate short-lived service-account keys across dozens of Google Cloud projects. Today, senior engineers run a Bash script from their laptops with the gcloud CLI, but executions frequently fail because team members have outdated SDK versions or stale local credentials.
Leadership asks you to redesign the workflow so that:
It is reproducible and consistent across engineers.
No long-lived credentials remain on engineer workstations.
Additional operational cost and complexity are avoided.
Which solution best meets these requirements?
Provision a small, always-running f1-micro Compute Engine VM in each project, install the Cloud SDK, copy the script to the instance, and allow engineers to SSH in and execute it when needed.
Package the script into a container image and deploy it to Cloud Run in every project. Expose an IAM-authenticated HTTPS endpoint that engineers call to trigger key rotation.
Create a Cloud Build pipeline that runs automatically every night in each project. Grant the Cloud Build runtime service account permissions to manage service-account keys so that each build rotates keys on schedule.
Store the key-rotation script in each engineer's Cloud Shell $HOME directory (persisted on the free 5-GB disk). Engineers open Cloud Shell on demand, run the script with the pre-installed gcloud CLI, and close the session when finished.
Running the rotation script interactively from Cloud Shell satisfies all stated goals:
Cloud Shell provides an up-to-date, fully authenticated gcloud CLI out of the box, so engineers no longer need to manage local SDK versions or credentials.
Placing the script in the Cloud Shell $HOME directory preserves it on the free 5-GB persistent disk across sessions, ensuring a consistent execution environment for all team members.
Engineers invoke the script only when rotation is actually required, so no automated job runs (and bills) when nothing needs to be done.
Because execution happens inside the ephemeral Cloud Shell VM, no credentials are stored on individual laptops, and the VM is shut down automatically when the session ends, limiting exposure.
The other options introduce unnecessary risk or cost:
Deploying the script to Cloud Run would expose a public endpoint and require careful handling of IAM and environment variables, increasing the attack surface.
A nightly Cloud Build pipeline would consume build minutes every day-even when rotation is unnecessary-and would still require granting the Cloud Build service account the ability to create and destroy keys.
Maintaining always-on Compute Engine VMs adds ongoing infrastructure cost and operational overhead without providing clear benefits over the on-demand environment that Cloud Shell already supplies.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Google Cloud Shell, and why is it suitable for this workflow?
Open an interactive chat with Bash
How does Cloud Shell preserve scripts and configurations across sessions?
Open an interactive chat with Bash
What are the security advantages of using ephemeral Cloud Shell VMs for key rotation?
Open an interactive chat with Bash
What is Cloud Shell in Google Cloud?
Open an interactive chat with Bash
How does Cloud Shell ensure security for service account key rotation?
Open an interactive chat with Bash
Why is Cloud Shell preferable over Cloud Run or Compute Engine for this workflow?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Managing implementation
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .