Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create data source for external groups #1185

Merged
merged 9 commits into from
Aug 16, 2022

Conversation

kfcampbell
Copy link
Member

@kfcampbell kfcampbell commented Jun 10, 2022

Fixes #1145.

When given a Terraform snippet like the following:

provider "github" {}

terraform {
  required_providers {
    github = {
      source  = "integrations/github"
    }
  }
}

locals {
  local_groups = "${data.github_external_groups.example_external_groups}"
}

output "groups" {
  value = local.local_groups
}

this PR will produce a state that looks like so:

Outputs:

groups = {
    external_groups = [
        {
            group_id   = 0
            group_name = "Test Group 0"
            updated_at = "2021-02-22T19:25:55Z"
        },
        {
            group_id   = 1
            group_name = "Test Group 1"
            updated_at = "2021-02-22T19:25:55Z"
        }
    ]
    id              = "/orgs/TEST_ORG_NAME/external-groups"
}

This will be helpful in retrieving groups for use in the EMU group mapping resource.

@kfcampbell kfcampbell changed the title Create data source for EMU groups Create data source for external groups Aug 15, 2022
@kfcampbell
Copy link
Member Author

@micbegind would the state captured in the PR description fix your issue?

@philthethrill99
Copy link

@kfcampbell Yes this would fix our issue

@kfcampbell kfcampbell marked this pull request as ready for review August 16, 2022 23:13
@kfcampbell kfcampbell merged commit 6b9e025 into integrations:main Aug 16, 2022
@kfcampbell kfcampbell deleted the data-source-emu-mapping branch August 16, 2022 23:17
kazaker pushed a commit to auto1-oss/terraform-provider-github that referenced this pull request Dec 28, 2022
* Initial commit of EMU data source

* Set groups in state

* Some renames

* Correct google/go-github client version to v45 in new data source

* Rename data source file to something more appropriate

* Set a sensible ID

* Add documentation for new data source

* Fix website formatting
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
* Initial commit of EMU data source

* Set groups in state

* Some renames

* Correct google/go-github client version to v45 in new data source

* Rename data source file to something more appropriate

* Set a sensible ID

* Add documentation for new data source

* Fix website formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub EMU external groups data source
2 participants