Terraform module for managing GitHub organization resources including repositories, teams, branch protection rules, and organization settings.
- 🏢 Organization settings management
- 📦 Repository provisioning via map
- 🔒 Branch protection rules
- 👥 Team management
- 🔑 Secrets and variables
- 📋 Rulesets
module "github" {
source = "git::https://github.com/your-org/terraform-github.git?ref=v1.0.0"
repositories = {
"my-app" = {
description = "Main application"
visibility = "private"
default_branch = "main"
}
"my-lib" = {
description = "Shared library"
visibility = "private"
default_branch = "main"
}
}
}| Name | Version |
|---|---|
| >= 1.7 | |
| ~> 6.0 |
| Name | Version |
|---|---|
github |
~> 6.0 |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
repositories |
Map of repositories to create | map(object) |
{} |
no |
default_branch |
Default branch name | string |
"main" |
no |
enforce_admins |
Enforce branch protection for admins | bool |
true |
no |
required_approvals |
Number of required PR approvals | number |
1 |
no |
| Name | Description |
|---|---|
repository_ids |
Map of repository names to node IDs |
repository_urls |
Map of repository names to URLs |
# Format
terraform fmt -recursive
# Validate
terraform validate
# Lint
tflint --recursive
# Security scan
tfsec .MIT