Infrastructure as Code Principles
On this page
Operational Principles
- Everything is reviewed: no direct apply from laptops in production.
- Plan is evidence: store plan outputs and approvals for audit.
- Idempotency: re-running should converge, not surprise.
Golden Workflow
- Format + validate
- Plan (read-only) and publish plan summary
- Policy checks (OPA / Sentinel / custom)
- Approval gate
- Apply using the same commit + same inputs
Command Skeleton (Tool-Agnostic)
# Validate locally or in CI iac fmt iac validate # Create a plan artifact (read-only preview) iac plan --out plan.bin # Apply exactly the planned change iac apply plan.bin
Failure Modes
- Applying without a saved plan: you cannot prove what changed.
- Changing variables between plan/apply: plan becomes meaningless.