Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

7.1. Importing Existing Infrastructure

💡 First Principle: Import solves a specific gap in the reconciliation model — a real resource exists but isn't in state, so Terraform doesn't know it owns it — and importing fills that gap by writing the resource into state, after which normal reconciliation takes over.

Why care: Adopting Terraform almost always means importing pre-existing infrastructure rather than recreating it. The exam tests what import does (and crucially, what it doesn't do automatically), and 004 adds the newer declarative import blocks.

The mental model: Importing is adopting a stray that's already living in your yard. The animal exists; you're just adding it to your records so you officially care for it. Adoption (import) doesn't create the animal — it records responsibility.

⚠️ Common Misconception: "Import writes the configuration for me." The classic terraform import command only brings a resource into state — you still have to author a matching resource block yourself. (Import blocks can generate config, but that's a separate, newer capability.)

Alvin Varughese
Written byAlvin Varughese
Founder18 professional certifications