Skip to content

GitHub EMU external groups data source #1145

Closed

Description

@micbegind

Hi there,

Terraform Version

Terraform v1.1.9
on linux_amd64
+ provider registry.terraform.io/integrations/github v4.25.0-alpha

Affected Resource(s)

  • github_emu_group_mapping

Expected Behavior

The GitHub Terraform provider should provide a data source to retrieve the GitHub EMU external groups group_id attribute so we can use it with the github_emu_group_mapping resource.

Actual Behavior

Actually the GitHub Terraform provider only provides the data source github_organization_team_sync_groups that does not work with GitHub EMU external groups. An alternative is to retrieve the external groups with the http data source and use the body of the HTTP response to create the external groups group_id attribute reference.

For example, we can create a data source and a local containing all the external groups attributes (group_name, group_id, updated_at) like that:

data "http" "external_groups" {
  url = "https://api.github.com/orgs/${var.github_org}/external-groups"

  request_headers = {
    Accept        = "application/vnd.github.v3+json"
    Authorization = "Bearer ${var.github_token}"
  }
}

locals {
  external_groups = jsondecode(data.http.external_groups.body)["groups"]
}

This should give us what we need but it would be far way better to get the attributes reference from a provider data source instead of having to deal with the raw body HTTP response coming from the REST API.

Activity

  1. added this to the v4.26.0 milestone on May 19, 2022
  2. modified the milestones: v4.26.0, v4.27.0 on May 27, 2022
  3. philthethrill99 commented on Jul 20, 2022

    @philthethrill99

    @kfcampbell Do we have an ETA of when the 4.27.0 will be out ?

  4. kfcampbell commented on Aug 13, 2022

    @kfcampbell
    Contributor

    I've updated #1185 a bit today, and hopefully will wrap this up next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions