Interview Prep/Terraform/State Internals

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.

All Terraform questions Roadmap: Terraform in production

More on State Internals