interview-prep
  • State file is sensitive — it contains secrets in plaintext. Encrypt the backend (S3 + KMS).
  • Don't edit state by hand — use terraform state commands.
  • Implicit vs explicit dependencies — Terraform infers dependencies from resource references. Use depends_on only when you can't reference the dependency directly.
  • count vs for_eachcount for identical copies, for_each for distinct named instances. for_each is usually safer because removing items doesn't reindex everything.
  • Drift — when something changes outside Terraform (someone clicks in the console). terraform plan will show drift; you decide whether to apply (revert) or import the change.

My notes