How do `moved` blocks compare to `terraform state mv`?
AdvancedConceptState Internals
Answer
Both rewrite addresses in state without touching real infrastructure. moved is declarative, shows in the plan as "has moved to", works for everyone who pulls the code (each environment's state migrates on its next apply) and is safe to keep. state mv is imperative, one-off and must be repeated per state file.
More on State Internals
What does the state file contain?BeginnerWhat is the difference between local and remote state?BeginnerHow do you configure the S3 backend?BeginnerWhat is state locking and why does it matter?IntermediateHow does S3-native locking work and how does it replace DynamoDB?AdvancedHow do you inspect resources in state?Beginner