GitHub Sync
Push code to GitHub, create pull requests, and keep infrastructure in version control.
Why GitHub Sync?
Version Control
Track all changes to your code
Collaboration
Work with team members
Code Review
Use pull requests for changes
CI/CD
Integrate with pipelines
Prerequisites
- GitHub integration configured in Settings > Integrations
- Access to the target repository
Connect Repository
Click GitHub Button
Click the GitHub button in the toolbar.
Select Repository
Select existing repo or create new one.
Choose Branch
Choose branch (e.g., main).
GitHub Actions
Click the GitHub dropdown to:
| Action | Description |
|---|---|
| Push to GitHub | Commit and push changes |
| Sync from GitHub | Pull remote changes |
| Check PR Status | View open PR status |
| View PR on GitHub | Open PR in browser |
Status Indicators
| Indicator | Meaning |
|---|---|
| Green checkmark | Synced with GitHub |
| Orange dot | Unpushed local changes |
| Blue arrow | Remote changes to pull |
| Red warning | Conflicts or errors |
Create Pull Request
Instead of pushing directly to main:
Open Pull Request Flow
Click GitHub → Create Pull Request in the toolbar.
Enter Details
Enter branch name (e.g., feature/add-rds), title, and description.
Create
Click Create to open the PR.
This creates a new branch and opens a PR for review.
Handling Conflicts
If conflicts exist:
| Option | What it does |
|---|---|
| Keep Local | Use your version |
| Keep Remote | Use GitHub's version |
| Merge | Manually combine changes |
Recommended .gitignore
**/.terraform/*
*.tfstate
*.tfstate.*
*.tfvars
*.tfvars.json
crash.log
override.tf
override.tf.json
.terraformrc
terraform.rc
- Commit after each logical change
- Use descriptive commit messages
- Create PRs for code review
- Never commit secrets or .tfvars with sensitive data
Example: Team Collaboration Workflow
Scenario
You're adding an RDS database to your infrastructure. Another team member is updating the security groups in the same project.
Your Workflow
Sync First
Click GitHub → Sync to pull teammate's changes.
Create Branch
GitHub → Create Pull Request → Name: feature/add-rds
Make Changes
Use AI chat to create the RDS configuration.
Push
Click GitHub → Push to update the PR.
Review
Teammate reviews PR on GitHub, approves.
Merge
PR merges to main, Deploy from main branch.
Commit History
main
├── a1b2c3d Add VPC and subnets (initial setup)
├── d4e5f6g Add security groups (teammate)
└── g7h8i9j [PR #12] Add RDS PostgreSQL instance (you)
PR Description Example
## Add RDS PostgreSQL Instance
Adds a managed PostgreSQL database for the application.
**Resources:**
- `aws_db_instance.main` - PostgreSQL 15.4 on db.t3.medium
- `aws_db_subnet_group.main` - Uses existing private subnets
- `aws_security_group.db` - Allows 5432 from app security group
**Cost Impact:** +$51.30/month
**Testing:**
- [ ] Validate passes
- [ ] Plan shows expected resources
- [ ] Security group rules are correct