Skip to content

Instantly share code, notes, and snippets.

@kerryhatcher
Created August 22, 2024 21:51
Show Gist options
  • Save kerryhatcher/afb110dcc5c76e3ae713ad529ad3a190 to your computer and use it in GitHub Desktop.
Save kerryhatcher/afb110dcc5c76e3ae713ad529ad3a190 to your computer and use it in GitHub Desktop.
GHEC EMU Managment
data "github_external_groups" "example_external_groups" {}
locals {
local_groups = data.github_external_groups.example_external_groups
}
output "groups" {
value = local.local_groups
}
resource "github_team" "some_team" {
for_each = { for g in local.local_groups.external_groups : g.group_name => g }
name = each.value.group_name
description = "Some cool team"
privacy = "closed"
lifecycle {
#prevent_destroy = true
}
}
resource "github_emu_group_mapping" "example_emu_group_mapping" {
for_each = { for g in local.local_groups.external_groups : g.group_name => g }
team_slug = each.value.group_name
group_id = each.value.group_id
depends_on = [github_team.some_team]
lifecycle {
#prevent_destroy = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment