Here are all the actual test exam dumps for IT exams. Most people prepare for the actual exams with our test dumps to pass their exams. So it's critical to choose and actual test pdf to succeed.

Exam Terraform-Associate-004 Topic 1 Question 255 Discussion

Actual exam question for HashiCorp's Terraform-Associate-004 exam
Question #: 255
Topic #: 1
You corrected a typo in a resource name, changing it from aws_s3_bucket.photoes to aws_s3_bucket.photos.
You want to update the Terraform state so that the existing resource is recognized under the new name, without destroying and recreating it. Which configuration should you use?

Suggested Answer: D Vote an answer

Rationale for Correct Answer: A moved block tells Terraform that an object's address in state has changed (renamed/refactored) and it should move the state from the old address to the new address. This preserves the existing real resource and prevents unnecessary destroy/recreate.
Analysis of Incorrect Options (Distractors):
A: Works but is unnecessarily risky/extra work; moved is the intended refactoring mechanism for renames.
B: Incorrect-refresh-only updates state to match real infrastructure, but it does not remap an object from one address to another.
C: Incorrect-Terraform will treat the new name as a new resource address and the old one as removed unless you explicitly move/rename state.
Key Concept: Refactoring addresses safely using moved blocks (state address migration).
Reference: Terraform Objectives - Implement and Maintain State (state management and refactoring), Read, Generate, and Modify Configurations (moved blocks).

by Myrna at May 13, 2026, 09:56 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.