← Terraform & Infrastructure as Code learning pathTerraform & Infrastructure as Code · Module 8 of 10
Terraform in CI/CD
Automate plan and apply safely.
📖 Key ideas
- Run fmt, validate and plan on every pull request.
- Post the plan for reviewers to read.
- Apply only after approval on the main branch.
- Authenticate with short-lived credentials (OIDC).
- Tools: GitHub Actions, Atlantis, Terraform Cloud/HCP Terraform.
💡 Real-life example: Automated Terraform is a two-key safe: the plan is shown, a reviewer turns the second key to apply.
Plan in PRShow changes for review
AtlantisPull request automation for Terraform
OIDCShort-lived identity federation
HCP TerraformHashiCorp's managed Terraform service