diff --git a/modules/team/README.md b/modules/team/README.md index 884bb1f..ff3387c 100644 --- a/modules/team/README.md +++ b/modules/team/README.md @@ -27,6 +27,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [parent\_id](#input\_parent\_id) | The ID of the parent team if it exists (optional). | `string` | `""` | no | | [privacy](#input\_privacy) | The privacy setting for the github team. Must be one of `closed` or `secret`. | `string` | `"closed"` | no | | [team\_description](#input\_team\_description) | Description of the github team to be created. | `string` | `""` | no | | [team\_id](#input\_team\_id) | The ID of the team if it exists (optional). | `string` | `""` | no | diff --git a/modules/team/team.tf b/modules/team/team.tf index 8803f4a..b9b1b54 100644 --- a/modules/team/team.tf +++ b/modules/team/team.tf @@ -3,8 +3,9 @@ locals { } resource "github_team" "team" { - count = local.create_team ? 1 : 0 - name = var.team_name - description = var.team_description - privacy = var.privacy -} \ No newline at end of file + count = local.create_team ? 1 : 0 + name = var.team_name + description = var.team_description + privacy = var.privacy + parent_team_id = var.parent_id +} diff --git a/modules/team/variables.tf b/modules/team/variables.tf index d8a9264..5e47fb9 100644 --- a/modules/team/variables.tf +++ b/modules/team/variables.tf @@ -34,4 +34,10 @@ variable "team_id" { type = string description = "The ID of the team if it exists (optional)." default = "" -} \ No newline at end of file +} + +variable "parent_id" { + type = string + description = "The ID of the parent team if it exists (optional)." + default = "" +} diff --git a/modules/team_set/README.md b/modules/team_set/README.md index 1a8243a..e209b1f 100644 --- a/modules/team_set/README.md +++ b/modules/team_set/README.md @@ -28,8 +28,8 @@ | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [preexisting\_teams](#input\_preexisting\_teams) | A map of existing teams where the key is the team name and the value is the configuration |
map(object({
bucket = string
prefix = string
output_name = string
maintainers = list(string)
members = list(string)
}))
| `{}` | no | -| [teams](#input\_teams) | A map of teams to create where the key is the team name and the value is the configuration |
map(object({
description = string
privacy = string
maintainers = list(string)
members = list(string)
}))
| n/a | yes | +| [preexisting\_teams](#input\_preexisting\_teams) | A map of existing teams where the key is the team name and the value is the configuration. If the team does not have a parent team, the parent\_id should be an empty string. |
map(object({
bucket = string
prefix = string
output_name = string
maintainers = list(string)
members = list(string)
parent_id = string
}))
| `{}` | no | +| [teams](#input\_teams) | A map of teams to create where the key is the team name and the value is the configuration. If the team does not have a parent team, the parent\_id should be an empty string. |
map(object({
description = string
privacy = string
maintainers = list(string)
members = list(string)
parent_id = string
}))
| n/a | yes | ## Outputs diff --git a/modules/team_set/teams.tf b/modules/team_set/teams.tf index 27aaa7a..498d3b8 100644 --- a/modules/team_set/teams.tf +++ b/modules/team_set/teams.tf @@ -7,6 +7,7 @@ module "team" { team_members = each.value.members team_description = each.value.description privacy = each.value.privacy + parent_id = each.value.parent_id team_name = each.key } @@ -18,5 +19,6 @@ module "prexisting_team" { team_maintainers = each.value.maintainers team_members = each.value.members + parent_id = each.value.parent_id team_name = each.key } diff --git a/modules/team_set/variables.tf b/modules/team_set/variables.tf index 40abc57..1bff325 100644 --- a/modules/team_set/variables.tf +++ b/modules/team_set/variables.tf @@ -4,8 +4,9 @@ variable "teams" { privacy = string maintainers = list(string) members = list(string) + parent_id = string })) - description = "A map of teams to create where the key is the team name and the value is the configuration" + description = "A map of teams to create where the key is the team name and the value is the configuration. If the team does not have a parent team, the parent_id should be an empty string." } variable "preexisting_teams" { @@ -15,7 +16,8 @@ variable "preexisting_teams" { output_name = string maintainers = list(string) members = list(string) + parent_id = string })) - description = "A map of existing teams where the key is the team name and the value is the configuration" + description = "A map of existing teams where the key is the team name and the value is the configuration. If the team does not have a parent team, the parent_id should be an empty string." default = {} }