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 is establishing a continuous integration and continuous deployment (CI/CD) GitOps pipeline using Cloud Build and Terraform to manage infrastructure across dev, stage, and prod Google Cloud projects.
Your security and compliance teams require the following:
Which pipeline design should you implement to meet these requirements?
main branch, disables state locking with -lock=false, and applies changes simultaneously to dev, stage, and prod projects using the default Compute Engine service account.This configuration uses self-managed virtual machines running periodic cron jobs with default Compute Engine service accounts to deploy infrastructure continuously without state locking or staging gates.
dev, stage, and prod completely eliminates the multi-environment validation lifecycle.-lock=false explicitly turns off concurrency protection, leading to race conditions and broken state files during concurrent execution.Editor), failing least-privilege standards.You were running a non-production batch synchronizer for ephemeral testing environments where state consistency, multi-tier promotion, and access security were not required.
terraform plan and validate the plan against policies using Open Policy Agent (OPA) or Conftest. Configure branch-specific triggers for promotion that impersonate environment-dedicated Service Accounts.This architecture establishes an enterprise-grade GitOps CI/CD pipeline for Infrastructure as Code (IaC) on Google Cloud. It utilizes Cloud Build, Terraform remote backends on Cloud Storage, automated Policy-as-Code (PaC) validation, and IAM Service Account Impersonation to enforce least privilege across isolated environments.
dev and prod. Enabling Object Versioning protects state files against corruption or accidental deletion, while the native Google Cloud Storage backend automatically handles state locking via Cloud Storage generation numbers.terraform plan output to JSON and validates it against predefined compliance policies using tools like Open Policy Agent (OPA) or Conftest. This prevents policy-violating resources (such as overly permissive IAM bindings or public firewall rules) from ever reaching production.dev, stage, and prod. Cloud Build pipelines run using dedicated, environment-scoped Service Accounts via IAM impersonation, ensuring non-production build steps have zero access to production resources.This approach aligns with Google Cloud architecture best practices for Terraform at scale. It completely segregates privileges, automates pre-merge governance, and eliminates long-lived static service account keys in CI/CD pipelines.
.tfstate files directly to the Git repository branches using git-crypt. Configure Cloud Build to execute terraform apply locally on each developer's workstation using developer OAuth credentials before code check-in.This approach uses Git repository storage for state files encrypted with git-crypt and relies on manual, client-side execution of Terraform using individual user credentials prior to committing code.
terraform apply locally removes the ability to centrally enforce automated policy checks before modifications occur on Google Cloud.You were managing a localized offline development environment without internet connectivity or access to remote Google Cloud Storage backends.
roles/owner across the Google Cloud organization, and execute terraform apply --auto-approve immediately upon pull request creation.This design uses a monolithic storage bucket with legacy access control lists (ACLs) and grants broad administrative permissions (roles/owner) to a single shared service agent, applying changes automatically upon pull request creation.
roles/owner at the organization level creates a single point of failure and allows lower-tier environments to alter production resources.--auto-approve on pull request creation skips the plan review and compliance inspection phases, allowing risky misconfigurations to be applied immediately.The scenario required a rapid single-project proof-of-concept (PoC) with no compliance requirements, no separate environments, and no need for pull request approvals.
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