Question 53 of 519
Implement and maintain statehardMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is to run terraform force-unlock with the lock ID. This is the appropriate next step because when a Terraform process crashes while holding a state lock, the lock entry persists in DynamoDB as a stale lock, blocking all subsequent operations. The terraform force-unlock command is specifically designed to override this stale state lock by directly removing the lock item from the DynamoDB locking table, safely releasing the lock without risking state corruption. On the HashiCorp Terraform Associate TF-003 exam, this scenario tests your understanding of state locking mechanics and the recovery workflow for crashed processes—a common trap is attempting to manually delete the DynamoDB entry, which bypasses Terraform’s safety checks and can corrupt state. Remember the memory tip: “Force unlock, don’t force delete” to reinforce that the command-line tool, not the database console, is the correct recovery path.

TF-003 Implement and maintain state Practice Question

This TF-003 practice question tests your understanding of implement and maintain state. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. 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.

An organization uses Terraform with AWS S3 backend and DynamoDB for state locking. During a plan, you receive an error: 'Error acquiring the state lock'. The lock information in DynamoDB shows a lock from a previous session that crashed. What is the most appropriate next step?

Question 1hardmultiple choice
Full question →

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

Run terraform force-unlock with the lock ID

The correct answer is B because when a Terraform process crashes while holding a state lock, the lock remains in DynamoDB and must be manually released. The `terraform force-unlock` command with the specific lock ID is the designed mechanism to override a stale lock, as it directly interacts with the DynamoDB locking table to remove the lock item. This is the safest and most appropriate method, as it ensures the lock is released in a controlled manner without risking state corruption.

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.

  • Run terraform unlock

    Why it's wrong here

    There is no terraform unlock command.

  • Run terraform force-unlock with the lock ID

    Why this is correct

    This command releases the lock from the previous session.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Wait for the lock to expire automatically

    Why it's wrong here

    Terraform locks do not expire automatically; they must be released manually.

  • Delete the lock item from DynamoDB table directly

    Why it's wrong here

    While possible, it bypasses Terraform's safety checks and is not the recommended approach.

Common exam traps

Common exam trap: answer the scenario, not the keyword

HashiCorp often tests the distinction between `terraform unlock` (a non-existent command) and `terraform force-unlock` (the actual command), trapping candidates who assume a generic 'unlock' verb exists without knowing the exact syntax.

Trap categories for this question

  • Command / output trap

    There is no terraform unlock command.

Detailed technical explanation

How to think about this question

Under the hood, Terraform uses a DynamoDB item with a primary key (LockID) that contains a unique lock ID, digest, and timestamp. The `force-unlock` command sends a DeleteItem API call to DynamoDB only after verifying the lock ID matches, ensuring only the intended lock is removed. In real-world scenarios, a crash during a long `terraform apply` can leave a stale lock, and without `force-unlock`, subsequent operations are blocked, halting all infrastructure changes until the lock is cleared.

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 practitioner preparing for the TF-003 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.

What to study next

Got this wrong? Here's your next step.

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

Related practice questions

Related TF-003 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 TF-003 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 TF-003 question test?

Implement and maintain state — This question tests Implement and maintain state — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Run terraform force-unlock with the lock ID — The correct answer is B because when a Terraform process crashes while holding a state lock, the lock remains in DynamoDB and must be manually released. The `terraform force-unlock` command with the specific lock ID is the designed mechanism to override a stale lock, as it directly interacts with the DynamoDB locking table to remove the lock item. This is the safest and most appropriate method, as it ensures the lock is released in a controlled manner without risking state corruption.

What should I do if I get this TF-003 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

Same concept, more angles

1 more ways this is tested on TF-003

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A DevOps engineer manages infrastructure with Terraform using an S3 backend with DynamoDB locking. During a `terraform apply`, the engineer's network connection drops. After reconnecting, they run `terraform plan` and get an error: "Error acquiring the state lock." The lock is from the previous session. The engineer has verified that no other operations are running. What is the appropriate next step to proceed?

medium
  • A.Delete the DynamoDB table and recreate it
  • B.Wait 15 minutes for the lock to expire automatically
  • C.Use `terraform force-unlock <lock_id>` to remove the stale lock
  • D.Run `terraform init` to reset the backend connection

Why C: When a lock is stuck, the correct action is to force-unlock using the lock ID. Option B is correct.

Keep practising

More TF-003 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 TF-003 practice question is part of Courseiva's free HashiCorp 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 TF-003 exam.