# Senior IaC playbook

Compressed reference for the senior-only IaC extension. Pair with [cheat-sheet.md](./cheat-sheet.md), [GLOSSARY.md](./GLOSSARY.md), and [repo-iac-map.md](./repo-iac-map.md).

## The senior shift
Intermediate understanding is: "I know Terraform, state, modules, Terragrunt, Workload Identity, KMS, and Atlantis."

Senior understanding is: "I can explain what Terraform truly owns here, how state changes plan trust, how module and Terragrunt structure behave like APIs, how keyless identity paths work end to end, and why infrastructure change safety and rollback honesty are different from app delivery."

## Six senior lenses
1. **Truthfulness beats slogans** — explain the Terraform-owned surface and its boundaries.
2. **State is operational** — state quality, drift, imports, and locking affect whether plans are trustworthy.
3. **Structure is an API** — modules, leaves, dependencies, and inherited config define consumer contracts.
4. **Trust chains matter** — Workload Identity, WIF, and KMS are one identity/secrets system, not isolated features.
5. **Blast radius is the review lens** — infra approval paths exist because destructive risk is higher.
6. **Rollback honesty matters** — recovery often means reconciliation, not a simple redeploy.

## Senior review checklist
- What does this Terraform change truly own, and what adjacent systems does it only influence indirectly?
- What state assumptions does this change rely on, and how much should we trust the current plan?
- Does this abstraction improve DRY without hiding too much dependency or blast-radius information?
- What identity or secrets trust path is being changed, and what over-permission risk follows?
- Is Atlantis approval/apply behavior strong enough for the blast radius of this change?
- If this goes badly, what does recovery really look like?

## Interview answer shapes
### What does Terraform really own here?
It owns much of the cloud foundation and trust wiring, but not every important platform dependency lives in this tree.

### Why is state a senior topic?
Because state determines plan trust, collaboration safety, drift handling, and recovery quality.

### Why do Workload Identity and WIF matter so much?
Because they explain the repo’s keyless trust story for pods and CI, and Terraform is where that trust is actually granted.

### Why is Atlantis gated so hard?
Because infrastructure blast radius is high, so reviewed plans, approval boundaries, restricted applies, and locking are part of the safety model.
