Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
Your enterprise DevOps team needs to implement an automated ephemeral environment strategy for feature branch testing on Google Cloud. Every time a developer opens a pull request (PR), an isolated environment containing dedicated Google Kubernetes Engine (GKE) workloads and supporting Google Cloud resources (such as Cloud Storage buckets and service accounts) must be created on-demand. The solution must ensure secure state isolation, prevent resource naming collisions across concurrent PRs, execute integration test suites, and automatically tear down all provisioned resources when the PR is closed or merged.
How should you architect this pipeline to meet these requirements?
This design leverages Cloud Composer (managed Apache Airflow) to orchestrate Google Cloud Deployment Manager to create a distinct top-level organization folder and a new standalone Cloud Billing Account for every single pull request.
The organization needed to provision long-term, completely isolated tenant environments for distinct external business acquisitions or independent subsidiaries with separate financial cost centers.
This pattern uses imperative gcloud CLI shell scripts inside Cloud Build to create GCP resources directly, deploying workloads into pre-existing, manually assigned namespaces in a static GKE cluster without an Infrastructure as Code (IaC) state management tool.
The environment required ad-hoc debugging on local workstations where lightweight CLI commands are preferred over structured IaC pipeline automation.
This approach relies on Cloud Scheduler triggering Cloud Build on a fixed periodic schedule (hourly) and running Terraform using a single shared default workspace in a central state backend.
The goal was to run periodic configuration drift detection and compliance auditing across long-lived, static environments rather than managing dynamic, event-driven ephemeral feature environments.
This architecture leverages Cloud Build triggers integrated with source repository events (such as pull request opening, synchronizing, and closing) alongside modular Terraform configurations that utilize dynamic state key paths in a centralized Cloud Storage (GCS) backend.
terraform apply when a PR is opened or updated, passing unique branch/PR identifiers (e.g., pr-${_PR_NUMBER}) to parameterize resource names and deploy workloads to isolated GKE namespaces.terraform init -backend-config="prefix=env/pr-${_PR_NUMBER}") ensures that concurrent branch builds maintain completely independent state files without locking or overwriting each other.terraform destroy pointing to the exact same dynamic state path, guaranteeing complete resource destruction and preventing cloud spend leakage.Dynamic Terraform state management combined with native Git webhook triggers in Cloud Build provides a fully declarative, event-driven, and cost-effective lifecycle for isolated preview environments without manual operational overhead.
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 Validated