Did you ever have a state lock or corrupted state? What did you do?
AdvancedBehavioralInfrastructure as Code & Terraform state
Answer
Good answer looks like → "A CI job was cancelled mid-apply and left a lock: Error acquiring the state lock. I confirmed no apply was running (checked the CI run and the DynamoDB lock item's Info field for who held it), then ran terraform force-unlock <LOCK_ID>. I ran plan to check the state matched reality. Since S3 versioning was on, we could have restored a previous state version if needed."
Follow-ups to expect → When is force-unlock dangerous? How would you recover a resource missing from state?
Red flags → Deleting the lock or state file without checking.
More on Infrastructure as Code & Terraform state
What did your Terraform state setup look like?IntermediateHow did you structure your Terraform code?BeginnerWhy did you use folders per environment rather than Terraform workspaces (or vice versa)?IntermediateHow did different Terraform stacks share information?IntermediateHow did you handle Terraform drift?IntermediateHow did you import existing resources into Terraform?Intermediate