Infrastructure as Code
Cheat sheet · https://pcornel.dk/topic.php?topic=5421
Answer
Infrastructure as Code expresses infrastructure intent in versioned machine-readable definitions so changes can be reviewed, planned, applied and verified repeatedly.
Remember
- Code review proves the definition was reviewed, not that the target is converged or healthy.
- State or engine metadata ≠ authoritative live-service health; always confirm with provider read-back and target acceptance checks.
- A green execution step ≠ complete convergence when later state persistence, external dependencies or workload readiness remain unverified.
- Provider/API success ≠ business outcome; keep engine evidence and target-domain evidence separate.
First checks
terraform plan— previewcheckov -d . / tfsec .— security scanterraform state list— managed resources
Verify in this order
code → plan → review → apply → state
Where it usually breaks
Code review proves the definition was reviewed, not that the target is converged or healthy. The proof boundary ends where provider/state evidence stops and target-domain acceptance begins.
Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.
Infrastructure as Code IaC proof-boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Definition / inputs | Exact revision, toolchain and effective inputs are reproducible | Different runner/version/input context changes evaluation |
| State / planning | Correct backend/state/lock, fresh reads and reviewed graph/plan | Wrong state/workspace, stale reads, unsafe replacement/destroy or missing lock |
| Execution | Expected provider/API operations complete and state persists | Partial apply, auth/API error, ambiguous retry or failed state write |
| Target proof | Independent read-back plus fresh plan confirm intended convergence | Engine success treated as workload acceptance or drift remains unexplained |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5421