Interview Prep/Terraform/Lifecycle, Dependencies, Provisioners and Drift

How do you detect drift?

IntermediateConceptLifecycle, Dependencies, Provisioners and Drift
Answer

Run terraform plan -refresh-only (or a normal plan -detailed-exitcode) on a schedule and alert on exit code 2. HCP Terraform offers health assessments that do this natively, and tools like driftctl (now archived) or Spacelift and env0 drift detection do the same. The goal is to find drift before you need an urgent change.

All Terraform questions Roadmap: Terraform in production

More on Lifecycle, Dependencies, Provisioners and Drift