๐๏ธ Terraform & Infrastructure as Code
- Why IaC: reproducibility, review, drift detection
- HCL: providers, resources, data sources, variables, outputs, locals
- State: remote backend (S3 with native state locking), state locking,
import,movedblocks - Modules: composition, versioning, the public registry
- Environments: workspaces vs directory-per-env; Terragrunt (awareness)
- Plan/apply in CI with review; policy as code (OPA/Conftest, Checkov/tfsec)
- OpenTofu (the open-source fork): know it exists
- Alternatives: Pulumi (IaC in Go/Java/TS), AWS CDK, Crossplane (K8s-native)
๐งช Labs (๐ข warm-up โ ๐ก core โ ๐ด hard โ โซ boss)
- ๐ก Modules for network, cluster, database, and bucket; remote state
- ๐ด
planon PR /applyon merge with approval; Checkov/tfsec policy checks - โซ Import an existing resource, refactor it with
movedblocks, zero diff
๐ง Cognitive tasks
- Pre-mortem: 5 ways Terraform can destroy production, and the guardrails for each
๐ฐ๏ธ Orbit integration
- The Orbit cloud environment
Go deeper
โ๏ธ Kubernetes Internals
Resources
- Terraform: Up & Running 3e (Brikman) โญ ยท HashiCorp tutorials