Interview Prep/Terraform/State Internals

Why should you not edit the state file by hand?

BeginnerConceptState Internals
Answer

A typo or wrong serial can corrupt state and orphan real infrastructure, and manual edits leave no audit trail. Use state mv, state rm, import, moved, removed or -replace, which validate changes. If you must edit, back up, change a pulled copy and push it with an incremented serial.

All Terraform questions Roadmap: Terraform in production

More on State Internals