Deployment & Infra
Infrastructure as Code: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the mechanism stick when you are the one at the terminal.
Reconstruct the unit’s core mechanisms — declarative desired state and idempotency, the plan/apply diff engine, the state file as identity map and hazard, locking under concurrency, and drift handling — without looking back at the lesson.
- 01What does it mean that IaC is declarative, and why does idempotency fall out of that?
- 02Walk through what terraform plan actually does, and name its three inputs.
- 03Why is the state file both the source of truth and the biggest hazard?
- 04Why do concurrent applies corrupt state, and what exactly does a lock prevent?
- 05Define drift, the safe way to detect it, and the silent-revert trap.
- 06What is immutable infrastructure, and how does it relate to drift?
If you could reconstruct each answer from memory, you hold the unit’s spine: declarative desired state makes apply idempotent; plan is a three-input diff engine (config, state, refreshed reality); the state file is the identity map that is also the hazard, so it lives locked and versioned and never carries secrets; concurrent writes corrupt state, which is why locking exists; and drift surfaces in plan but is reconciled silently, so you detect it with -refresh-only and decide intent before applying — leaning on immutable infrastructure so there is less to drift in the first place.