What stages does a good Terraform pull-request pipeline have?
BeginnerProductionCI/CD and Automation
Answer
On every PR: terraform fmt -check -recursive, init -backend=false plus validate, tflint, Checkov or Trivy, then plan -out with the plan summary posted as a PR comment and cost estimate from Infracost. On merge to main: apply the reviewed plan to dev automatically and to higher environments after approval. Fast checks first, expensive ones later.
More on CI/CD and Automation
Why run Terraform from a pipeline instead of laptops?BeginnerHow do you make sure the apply runs exactly what was reviewed?IntermediateHow do you serialize applies to the same stack in CI?AdvancedShow a minimal GitHub Actions workflow for plan on PR.BeginnerHow does OIDC authentication from GitHub Actions to AWS work?IntermediateWhat is Atlantis and how does the flow work?Beginner