The correct answer is to run terraform state mv to rename the resource in state. This command directly updates the resource address in the Terraform state file from aws_instance.web to aws_instance.web2, matching the new configuration without triggering a destroy-and-create cycle. When you change a resource name in code, Terraform sees it as a new resource because the state still references the old address; terraform state mv bridges that gap by moving the existing state binding to the new name. On the HashiCorp Terraform Associate TF-003 exam, this scenario tests your understanding of state management versus resource replacement—a common trap is assuming terraform apply will simply rename the resource, but it actually plans to destroy the old and create the new, risking downtime. Remember the mnemonic: “Move the state, don’t recreate the fate.”
TF-003 Implement and maintain state Practice Question
This TF-003 practice question tests your understanding of implement and maintain state. Examine the command output carefully: the correct answer depends on what the output actually shows, not on general recall alone. 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.
Exhibit
$ terraform state list
aws_instance.web
aws_security_group.sg
Refer to the exhibit. A developer modifies the configuration by changing the resource name from 'aws_instance.web' to 'aws_instance.web2'. After running terraform plan, the output indicates that a new resource 'aws_instance.web2' will be created, but no resource will be destroyed. What should the developer do to update the state to match the configuration?
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Run terraform state mv to rename the resource in state.
Option A is correct because terraform state mv updates the resource address in the state file to match the new configuration name. Option B is wrong because removing and re-importing is unnecessary and more complex. Option C is wrong because terraform apply would try to create the new resource and destroy the old one, causing potential downtime. Option D is wrong because terraform refresh only updates attributes, not resource addresses.
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 state mv to rename the resource in state.
Why this is correct
terraform state mv renames the resource address in state, so plan will treat it as the same resource.
Related concept
Read the scenario before looking for a memorised answer.
✗
Run terraform refresh to synchronize the state.
Why it's wrong here
terraform refresh only updates attribute values, not resource addresses.
✗
Run terraform state rm to remove the old resource and then run terraform import.
Why it's wrong here
Removing and re-importing is unnecessary and more complex than using state mv.
✗
Run terraform apply, which will automatically update the state.
Why it's wrong here
terraform apply will try to create the new resource and destroy the old one, causing unnecessary changes.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.
Detailed technical explanation
How to think about this question
This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.
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.
Use explanations to understand the rule behind the answer.
TExam Day Tips
→Underline the problem statement mentally.
→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 TF-003 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.
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 state mv to rename the resource in state. — Option A is correct because terraform state mv updates the resource address in the state file to match the new configuration name. Option B is wrong because removing and re-importing is unnecessary and more complex. Option C is wrong because terraform apply would try to create the new resource and destroy the old one, causing potential downtime. Option D is wrong because terraform refresh only updates attributes, not resource addresses.
What should I do if I get this TF-003 question wrong?
Identify which TF-003 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.
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 →
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.
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.
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.
Sign in to join the discussion.