GitHub Actions Terraform Pipeline
Terraform plan posted as PR comment, apply on merge, state locking enforced, manual approval gate for production. Supports multiple workspaces.
Terraform Plan & Apply Pipeline with PR Comments
A GitHub Actions workflow that brings proper CI/CD discipline to your Terraform infrastructure — plan on PR, comment results inline, apply on merge, with a manual approval gate protecting production.
What's Included
- Terraform plan output posted as a formatted PR comment
- Apply on merge to main with state locking enforced
- Manual approval gate for production workspace deployments
- Multi-workspace support (dev, staging, prod)
- Plan diff summary with resource counts
What You Get
terraform.yml— main workflow, drop into.github/workflows/- Backend configuration examples for S3 + DynamoDB state locking
- GitHub Environment configuration guide for approval gates
README.md— setup and secrets reference
Requirements
- S3 bucket for Terraform state
- DynamoDB table for state locking
- AWS credentials with appropriate Terraform permissions