Quickstart
Get started with Terraform Branch Deploy in your repository in just a few steps.
Prerequisites
Before you begin, make sure you have:
- A GitHub repository with your Terraform configuration files
- Cloud provider credentials (AWS, Azure, GCP, etc.)
- Permissions to use GitHub Actions and Deployments
1. Add the Workflow
Create a workflow file at .github/workflows/terraform-deploy.yml in your repository:
2. Configure Environments
Add a .tf-branch-deploy.yml file to your repository root. Example:
3. Deploy from a Pull Request
Comment on any pull request to preview, deploy, or rollback changes:
.plan to dev— Preview changes for thedevenvironment.apply to dev— Deploy changes to thedevenvironment.apply main to prod— Rollbackprodto themainbranch
Tip
Add extra Terraform arguments with a pipe, e.g. .plan to dev | -var=debug=true
Next Steps
- See Configuration for advanced options
- Explore Commands for all supported PR commands
- Learn about Advanced Workflows and best practices