professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Your data engineering team manages cloud data infrastructure—including BigQuery datasets, Cloud Storage buckets, and Dataflow pipelines—across dev and prod environments on Google Cloud. You need to implement a continuous integration and continuous deployment (CI/CD) GitOps workflow using Terraform and Cloud Build that meets the following requirements:
How should you structure your Terraform configuration, state storage, and Cloud Build triggers?
This solution implements a declarative GitOps pipeline using Cloud Build and Terraform configured with a Cloud Storage (GCS) remote backend across isolated environment branches and directories.
backend "gcs") automatically provides state locking to prevent concurrent modification race conditions. Defining distinct prefixes (e.g., prefix = "env/dev" and prefix = "env/prod") separates environment state files, while enabling Object Versioning on the bucket maintains an audit history and provides recovery points against accidental state corruption.terraform init and terraform plan against environment subfolders. Configuring these builds as required status checks under branch protection rules ensures that syntax errors or unintended infrastructure mutations are caught before code is merged.terraform apply is strictly restricted to pushes/merges onto the designated dev and prod branches. Infrastructure is first tested in dev, and promoting the tested code via a pull request from dev to prod triggers the production terraform apply against the production environment directory.This pattern establishes an automated, repeatable, and secure workflow. It prevents unauthorized live changes, ensures code peer reviews include plan outputs, and cleanly separates environment state without managing complex external orchestrators.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.