Interview Prep/Terraform/Import Refactoring Drift and Lifecycle

How would you run drift detection across 80 workspaces?

AdvancedScenarioImport Refactoring Drift and Lifecycle
Answer

Situation read → One-off checks don't scale.

What I'd do →

  1. In HCP Terraform, enable health assessments (drift detection) on workspaces; or in CI run a nightly matrix of plan -detailed-exitcode -refresh-only with a read-only role.
  2. Aggregate results: Slack alerts for drift, tickets with an owner by workspace tag.
  3. Track a drift metric over time.
  4. Decide a policy: auto-revert for non-prod, ticket for prod.

Why → The goal is mean time to detect drift, not just detection.

Interview tip → Say who acts on the alert.

All Terraform questions Roadmap: Terraform in production

More on Import Refactoring Drift and Lifecycle