Question 753 of 1,000
hardMultiple ChoiceObjective-mapped

Google ACE Practice Question: Managing Terraform state for a GCP infrastructure…

This ACE practice question tests your understanding of ace exam topics. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You are managing Terraform state for a GCP infrastructure project shared by a team of 5 engineers. You need to prevent simultaneous `terraform apply` operations from causing state corruption. What is the recommended backend configuration?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure the `gcs` backend in Terraform, pointing to a Cloud Storage bucket with versioning enabled.

Option B is correct because the `gcs` backend with versioning enabled provides both remote state storage and built-in state locking via Cloud Storage's object-level consistency model. When one engineer runs `terraform apply`, the backend acquires a lock by writing a lock file to the bucket; other concurrent operations are blocked until the lock is released, preventing state corruption. Versioning further protects against accidental state deletion or corruption by allowing rollback to previous state versions.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Store state locally on each engineer's machine and merge state files manually after each apply.

    Why it's wrong here

    Local state per engineer leads to state divergence and conflicts. There is no reliable merge process for Terraform state — this approach will cause corruption.

  • Configure the `gcs` backend in Terraform, pointing to a Cloud Storage bucket with versioning enabled.

    Why this is correct

    The GCS backend stores state remotely with automatic state locking. Concurrent applies are prevented — the second apply fails with a lock error until the first completes. Versioning provides state history for rollback.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use Terraform Cloud (HashiCorp) as the backend for state locking.

    Why it's wrong here

    Terraform Cloud is a valid solution for locking, but the question asks for GCP-native configuration. GCS backend achieves the same on GCP.

  • Use a Cloud Source Repository to store state files with branch-based locking.

    Why it's wrong here

    Git repositories are not designed for Terraform state — they don't provide atomic locking and state files contain sensitive information that shouldn't be in version control.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the distinction between a remote backend that supports locking (like `gcs` or `s3`) versus a remote backend that only stores state (like `consul` without locking or a plain HTTP backend), and the trap here is that candidates may think any remote storage (like Cloud Source Repository) or a third-party service (like Terraform Cloud) is equally valid, when the question specifically requires a GCP-native solution with locking.

Detailed technical explanation

How to think about this question

The `gcs` backend uses Cloud Storage's object generation numbers and conditional writes (via `If-Match` / `If-None-Match` headers) to implement optimistic locking. When Terraform acquires a lock, it writes a metadata-only object (e.g., `.terraform.lock`) to the bucket; if another process attempts to write the same lock object, the conditional write fails, preventing simultaneous state modifications. Versioning is critical because it retains all previous state file versions, enabling recovery from accidental corruption or overwrites — a common real-world scenario when a lock is released prematurely or a network partition occurs during `terraform apply`.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

Related practice questions

Related ACE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free ACE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this ACE question test?

Read the scenario before looking for a memorised answer.

What is the correct answer to this question?

The correct answer is: Configure the `gcs` backend in Terraform, pointing to a Cloud Storage bucket with versioning enabled. — Option B is correct because the `gcs` backend with versioning enabled provides both remote state storage and built-in state locking via Cloud Storage's object-level consistency model. When one engineer runs `terraform apply`, the backend acquires a lock by writing a lock file to the bucket; other concurrent operations are blocked until the lock is released, preventing state corruption. Versioning further protects against accidental state deletion or corruption by allowing rollback to previous state versions.

What should I do if I get this ACE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More ACE practice questions

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.