Describe the need
Right now it is impossible to create an arbitrarily-nested set of groups without creating n separate resources for a hierarchy of depth n. This is because you need the ID/slug of each team which is generated by github on creation, and you cannot guarantee the order in which terraform creates groups even if you decided to re-implement the slug generation in your configuration.
Because the parent_team_id property is only settable via the github_team resource itself you are forced to do non-scalable solutions like creating multiple instances of the resource e.g. github_team.level_0 github_team.level_1 and mapping your group hierarchy onto those resources.
Instead a separate 'linking' resource could be created e.g.
resource "github_team_hierarchy" "parents" {
parent_id = github_team.teams["parent"].id
child_id = github_team.teams["child"].id
}
This would force terraform to create all the groups first, and then update their parent/child relations afterwards.
SDK Version
No response
API Version
No response
Relevant log output
Code of Conduct
Describe the need
Right now it is impossible to create an arbitrarily-nested set of groups without creating
nseparate resources for a hierarchy of depthn. This is because you need the ID/slug of each team which is generated by github on creation, and you cannot guarantee the order in which terraform creates groups even if you decided to re-implement the slug generation in your configuration.Because the
parent_team_idproperty is only settable via thegithub_teamresource itself you are forced to do non-scalable solutions like creating multiple instances of the resource e.g. github_team.level_0 github_team.level_1 and mapping your group hierarchy onto those resources.Instead a separate 'linking' resource could be created e.g.
This would force terraform to create all the groups first, and then update their parent/child relations afterwards.
SDK Version
No response
API Version
No response
Relevant log output
Code of Conduct