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.
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