Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Architect practice bank has 2,335 more like it. Try 10 free: instant score, no account.
A distributed engineering team is collaborating on Google Cloud infrastructure provisioning using Terraform. The team is experiencing issues where concurrent execution of terraform apply causes state corruption and race conditions. In addition, the team needs to protect sensitive state data and ensure that previous versions of the state file can be restored if corrupted.
Which backend configuration should you implement to satisfy these requirements?
Using the local backend stores the terraform.tfstate file directly on the machine executing the Terraform commands. Committing this file to a version control system like Git uses repository branch protection and pull request workflows to coordinate changes across a team.
terraform apply against the actual cloud environment concurrently, resulting in conflicting resource states and race conditions..tfstate file is extremely error-prone and often leads to permanent state corruption.You were working on a single-user, non-production prototype that contains no sensitive credentials and has no risk of concurrent modifications.
The Google Cloud Storage (GCS) backend for Terraform is a native remote backend mechanism designed to store Terraform state files (.tfstate) securely in a centralized Cloud Storage bucket. Storing state centrally allows distributed teams to share a single, authoritative representation of their managed infrastructure.
gcs backend natively provides state locking using Cloud Storage object preconditions and generations. Whenever an engineer or CI/CD pipeline runs terraform plan or terraform apply, Terraform acquires an exclusive lock on the remote state file. This prevents concurrent executions from running simultaneously and corrupting the state.roles/storage.objectAdmin or roles/storage.objectViewer) and secured with customer-managed or Google-managed encryption keys.The gcs backend natively satisfies all enterprise requirements for state consistency, concurrency locking, disaster recovery, and fine-grained security without adding architectural complexity or third-party overhead.
This option configures the gcs backend for state storage while attempting to use a relational database in Cloud SQL as a secondary coordination lock mechanism to prevent concurrent execution conflicts.
gcs backend natively handles state locking directly within Google Cloud Storage using object preconditions and generation numbers.gcs backend does not support or require an external relational database table to manage locks. Provisioning Cloud SQL for this purpose adds unnecessary infrastructure cost, maintenance overhead, and failure points without providing any operational benefit.Terraform lacked built-in locking mechanisms for Cloud Storage objects and mandated an external database table to coordinate concurrency.
Object Lifecycle Management in Cloud Storage is used to automate data management tasks such as transitioning objects to colder storage classes (e.g., Nearline, Coldline, Archive) or deleting objects after a specific retention period. BigQuery is a serverless enterprise data warehouse designed for SQL analytics.
terraform apply collisions across distributed engineers.The objective was to analyze historical infrastructure asset configurations over time using SQL analytics queries rather than managing Terraform runtime state and concurrency.
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