How did you handle Terraform drift?
IntermediateBehavioralInfrastructure as Code & Terraform state
Answer
Good answer looks like → "A nightly job ran terraform plan -detailed-exitcode per stack; exit code 2 means changes, which posted to Slack with the diff. For each drift we decided: if the manual change was right, codify it; otherwise apply to revert it. We reduced drift at the source by removing console write access for humans in production."
Follow-ups to expect → What was the most common source of drift? How do you handle attributes changed by AWS itself?
Red flags → Discovering drift only when an apply unexpectedly destroys something.
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?IntermediateDid you ever have a state lock or corrupted state? What did you do?AdvancedHow did you import existing resources into Terraform?Intermediate