-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Marco edited this page Feb 3, 2026
·
2 revisions
This guide walks you through setting up the GitHub Organization Terraform Template.
- Terraform >= 1.0
- GitHub account with organization or personal account
- GitHub Personal Access Token
- Click "Use this template" on the repository page
- Name your new repository (e.g.,
github-configs) - Clone your new repository locally
- Fork this repository
- Clone your fork locally
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
-
repo- Full control of private repositories -
admin:org- Full control of orgs and teams -
delete_repo- Delete repositories (optional)
-
- Copy the token
Create a .env file (never commit this):
cp .env.example .env
# Edit .env and add your tokenOr export directly:
export GITHUB_TOKEN="ghp_your_token_here"Edit config/config.yml:
organization: your-org-name # Your GitHub org or username
subscription: free # Your GitHub planEdit config/groups.yml to customize shared settings:
base:
teams:
your-team: push # Add your teams
oss:
visibility: public
has_issues: true
# ... customize as needed
internal:
visibility: private
# ... customize as neededEdit config/repositories.yml:
my-first-repo:
description: "My first managed repository"
groups: ["base", "oss"]
topics:
- terraform
- managed
my-private-tool:
description: "Internal tooling"
groups: ["base", "internal"]# Initialize Terraform
make init
# Preview changes (safe - no modifications)
make plan
# Apply changes (creates/updates repositories)
make applyAfter applying:
- Check your GitHub organization for the new repositories
- Verify settings match your configuration
- Check rulesets are applied (for public repos on free tier)
- Read Configuration-Reference for all available options
- Read Customization to extend the template
- Import existing repos with
./scripts/onboard-repos.sh --list - Set up CI/CD automation (see Customization for examples)
- Verify your
GITHUB_TOKENis set correctly - Check token has required scopes
- Ensure token hasn't expired
- Verify organization name in
config/config.yml - Ensure token has access to the organization
- This is expected on GitHub Free tier
- Upgrade to Pro/Team for private repo rulesets
For existing repositories, import them:
cd terraform
terraform import 'module.repositories["repo-name"].github_repository.this' org-name/repo-nameSee Troubleshooting for more solutions.
Getting Started
Reference
Advanced