Modules
Cheat sheet · https://pcornel.dk/topic.php?topic=5432
Answer
IaC modules package reusable configuration behind explicit inputs, outputs and provider/dependency contracts.
Remember
- Module reuse ≠ isolation; modules still share state, provider contexts and dependency graphs according to configuration.
- 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 get— fetch modules- Module version pinning (?ref=v1.2.0 / version =) — stability
terraform-docs markdown .— module docs
Verify in this order
module call → resources → outputs
Where it usually breaks
Module reuse ≠ isolation; modules still share state, provider contexts and dependency graphs according to configuration. The proof boundary ends where provider/state evidence stops and target-domain acceptance begins.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness. Preserve at least three independent checks: prerequisite/interface or identity/transport state; the owning control/service/policy state; then effective data-plane, backend or workload state. A healthy upstream boundary does not prove the downstream consumer or return path.
Modules 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=5432