https://github.com/notablehealth/terraform-github-teams
Terraform module to manage GitHub teams
https://github.com/notablehealth/terraform-github-teams
github github-teams terraform terraform-module
Last synced: about 1 year ago
JSON representation
Terraform module to manage GitHub teams
- Host: GitHub
- URL: https://github.com/notablehealth/terraform-github-teams
- Owner: notablehealth
- Created: 2023-07-01T22:46:22.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T00:31:13.000Z (over 1 year ago)
- Last Synced: 2025-02-11T11:59:17.937Z (about 1 year ago)
- Topics: github, github-teams, terraform, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/notablehealth/teams/github
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# terraform-github-teams
[](https://github.com/notablehealth/terraform-github-teams/releases)
[Terraform Module Registry](https://registry.terraform.io/modules/notablehealth/teams/github)
Terraform module to manage GitHub teams
## Requirements
- GitHub personal access token with admin rights to an organization
- Provide token via environment variable
>>export GITHUB\_TOKEN='TOKEN'
## Features
- 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.
## Usage
Basic usage of this module is as follows:
```hcl
module "example" {
source = "notablehealth//github"
# Recommend pinning every module to a specific version
# version = "x.x.x"
# Required variables
github_owner =
}
```
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.5 |
| [github](#requirement\_github) | ~> 6.3 |
## Providers
| Name | Version |
|------|---------|
| [github](#provider\_github) | 5.29.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [github_team.teams_level2](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team) | resource |
| [github_team.teams_level3](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team) | resource |
| [github_team.teams_level4](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team) | resource |
| [github_team.teams_root](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team) | resource |
| [github_team_members.self](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_members) | resource |
| [github_team_repository.self](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_repository) | resource |
| [github_team_settings.self](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_settings) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [github\_owner](#input\_github\_owner) | GitHub organization | `string` | n/a | yes |
| [teams](#input\_teams) | GitHub Team configuration objects |
map(object({
name = string
description = string
privacy = optional(string, "closed")
parent_team = optional(string)
members = optional(list(object({
full_name = optional(string)
username = string
role = optional(string, "member")
})))
repository = optional(object({
name = string
permission = optional(string, "pull")
}))
review_request_delegation = optional(object({
algorithm = optional(string, "ROUND_ROBIN")
member_count = optional(number)
notify = optional(bool)
}))
})) | `{}` | no |
## Outputs
| Name | Description |
|------|-------------|
| [repositories](#output\_repositories) | Team repository permissions |
| [teams\_level2](#output\_teams\_level2) | GitHub level 2 teams |
| [teams\_level3](#output\_teams\_level3) | GitHub level 3 teams |
| [teams\_level4](#output\_teams\_level4) | GitHub level 4 teams |
| [teams\_root](#output\_teams\_root) | GitHub root level teams |