Terraform module to manage GitHub teams
- GitHub personal access token with admin rights to an organization
- Provide token via environment variable
export GITHUB_TOKEN='TOKEN'
- Manage GitHub teams
- Manage nested teams (currently 4 levels)
- Manage team members
Terraform doesn't handle dynamic recursion or resource dependencies. To do nested teams, the code would either need to be run multiple times or manage a fixed maximum number of levels. This module manages up to 4 levels of nesting. But could easily be expanded to more.
Basic usage of this module is as follows:
module "example" {
source = "notablehealth/<module-name>/github"
# Recommend pinning every module to a specific version
# version = "x.x.x"
# Required variables
github_owner =
}
Name | Version |
---|---|
terraform | >= 1.5 |
github | ~> 6.3 |
Name | Version |
---|---|
github | 5.29.0 |
No modules.
Name | Type |
---|---|
github_team.teams_level2 | resource |
github_team.teams_level3 | resource |
github_team.teams_level4 | resource |
github_team.teams_root | resource |
github_team_members.self | resource |
github_team_repository.self | resource |
github_team_settings.self | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
github_owner | GitHub organization | string |
n/a | yes |
teams | GitHub Team configuration objects | map(object({ |
{} |
no |
Name | Description |
---|---|
repositories | Team repository permissions |
teams_level2 | GitHub level 2 teams |
teams_level3 | GitHub level 3 teams |
teams_level4 | GitHub level 4 teams |
teams_root | GitHub root level teams |