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.
More on Lifecycle, Dependencies, Provisioners and Drift
What are meta-arguments?BeginnerWhat lifecycle options are available?BeginnerHow does `create_before_destroy` work and what can go wrong?AdvancedWhat does `prevent_destroy` guarantee and what does it not?AdvancedWhen do you use `ignore_changes`?IntermediateWhat does `replace_triggered_by` do?Advanced