HashiCorp Terraform 003 Import and Drift Guide

Study HashiCorp Terraform 003 Import and Drift: key concepts, common traps, and exam decision cues.

This lesson matters because Terraform maintenance questions are usually about who changed what and how Terraform should react. Import, drift, and replacement are related, but they are not the same operation.

Maintenance chooser

Requirement Strongest first fit
bring an existing resource under Terraform management import
detect or reconcile out-of-band change drift handling
intentionally recreate one resource -replace

Decision order that usually wins

  1. Ask whether Terraform is adopting, detecting out-of-band change, or intentionally recreating.
  2. Use import when the resource already exists and must enter Terraform management.
  3. Use drift reasoning when reality changed outside Terraform.
  4. Use -replace when recreation is intentional.
  5. Read the plan before taking destructive action.

Common traps

Trap Better rule
assuming import means Terraform created the object import adopts management
treating drift like a provider bug by default drift often means reality changed outside Terraform
using destructive fixes before understanding the diff inspect plan and state first

Quiz

Loading quiz…
Revised on Sunday, May 10, 2026