Skip to content

Instantly share code, notes, and snippets.

@brunapereira
Created April 11, 2021 19:48
Show Gist options
  • Save brunapereira/6d173cad00978b4a43fa613c5675e353 to your computer and use it in GitHub Desktop.
Save brunapereira/6d173cad00978b4a43fa613c5675e353 to your computer and use it in GitHub Desktop.
team main with membership
resource "github_team" "engineers-team" {
name = "Engineers"
description = "organization engineers"
privacy = "closed"
}
resource "github_team" "admins-team" {
name = "Admins"
description = "organization admins"
privacy = "closed"
}
resource "github_team_membership" "engineer-members" {
for_each = var.engineer-members
username = each.value
team_id = github_team.engineers-team.id
role = "member"
}
resource "github_team_membership" "admin-maintainers-for-engineers-team" {
for_each = var.admin-members
username = each.value
team_id = github_team.engineers-team.id
role = "maintainer"
}
resource "github_team_membership" "admin-maintainers-for-admins-team" {
for_each = var.admin-members
username = each.value
team_id = github_team.admins-team.id
role = "maintainer"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment