Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions terraform/production/org.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ admins = [
"williln",
]

super_admins = [
"cunla",
"ryancheley",
"Stormheg",
"tim-schilling",
"williln",
]

# Design members
designers = [
"akshayvinchurkar",
Expand Down Expand Up @@ -109,10 +117,23 @@ members = [
"viscofuse",
"Zakui",
]

organization_teams = {
# This team should be enabled as moderators which can't be configured
# via the GitHub Terraform integration.
# https://github.com/organizations/django-commons/settings/moderators
"Admins" = {
description = "django-commons administrators"
description = "django-commons administrators team with moderator permissions in the org."
# Use maintainers for organizational teams
maintainers = [
"cunla",
"ryancheley",
"Stormheg",
"tim-schilling",
"williln",
]
}
"operations" = {
description = "django-commons operations team with admin permissions in the org."
# Use maintainers for organizational teams
maintainers = [
"cunla",
Expand Down
5 changes: 3 additions & 2 deletions terraform/resources-org.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GitHub Membership Resource
# https://registry.terraform.io/providers/integrations/github/latest/docs/resources/membership
data "github_users" "users" {
usernames = setunion(var.admins, var.members)
usernames = setunion(var.admins, var.super_admins, var.members)
}

output "invalid_users" {
Expand All @@ -10,7 +10,8 @@ output "invalid_users" {

locals {
users = merge(
{ for user in var.admins : user => "admin" if contains(data.github_users.users.logins, user) },
{ for user in var.admins : user => "member" if contains(data.github_users.users.logins, user) },
{ for user in var.super_admins : user => "admin" if contains(data.github_users.users.logins, user) },
{ for user in var.members : user => "member" if contains(data.github_users.users.logins, user) }
)
}
Expand Down
7 changes: 6 additions & 1 deletion terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# https://www.terraform.io/language/values/variables

variable "admins" {
description = "A set of admins to add to the organization"
description = "A set of users who are admins to add to the organization"
type = set(string)
}

variable "super_admins" {
description = "A set of users who have operational permissions to add to the organization"
type = set(string)
}

Expand Down