Skip to content

[FEAT]: Ability to set group parent with a separate resource #3208

@jackmtpt

Description

@jackmtpt

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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions