diff --git a/terraform/production/org.tfvars b/terraform/production/org.tfvars index c49e5ba..9ce3d45 100644 --- a/terraform/production/org.tfvars +++ b/terraform/production/org.tfvars @@ -7,6 +7,14 @@ admins = [ "williln", ] +ops_team = [ + "cunla", + "ryancheley", + "Stormheg", + "tim-schilling", + "williln", +] + # Design members designers = [ "akshayvinchurkar", @@ -101,10 +109,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", diff --git a/terraform/resources-org.tf b/terraform/resources-org.tf index 3022e2d..b193799 100644 --- a/terraform/resources-org.tf +++ b/terraform/resources-org.tf @@ -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.ops_team, var.members) } output "invalid_users" { @@ -11,6 +11,7 @@ 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.ops_team : 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) } ) } diff --git a/terraform/variables.tf b/terraform/variables.tf index 108ed16..69ab8a1 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -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 "ops_team" { + description = "A set of users who have operational permissions to add to the organization" type = set(string) }