GCP Professional Cloud Architect Practice Question

Your team needs CI integration tests for a Terraform module that provisions a Cloud Run service, a Pub/Sub topic, and IAM bindings. For each GitHub pull request the pipeline must: 1) create the stack in an isolated Google Cloud environment, 2) run a smoke test that invokes the new Cloud Run HTTP endpoint, and 3) delete all resources afterward. The production GCS state bucket must remain untouched, costs kept low, and IAM impact limited to the test. Which approach best meets these goals?

  • Use Cloud Build with Cloud Deploy to push the module to a shared staging project where resources remain permanently, run tests there, and skip the destroy step to save time.

  • Have Cloud Build apply each resource in the production project with -target, run tests, and then re-apply the main branch state to roll back the changes.

  • Use a Cloud Build pull-request trigger that creates a temporary project with a least-privilege service account, overrides the Terraform backend to a per-PR GCS bucket, runs terraform apply, invokes gcloud run services invoke for the smoke test, then runs terraform destroy and deletes the project.

  • Trigger a Cloud Function that deploys the module with Deployment Manager in the production project, runs tests, and removes the Deployment Manager deployment afterward.

GCP Professional Cloud Architect
Managing implementation
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