Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Created March 5, 2020 17:33
Show Gist options
  • Save soerenmartius/89ae86e42ec047aea89213e1a6c47a37 to your computer and use it in GitHub Desktop.
Save soerenmartius/89ae86e42ec047aea89213e1a6c47a37 to your computer and use it in GitHub Desktop.
How to manage your GitHub Organization with Terraform - organization
locals {
# A map of admin machine users. These users are used for tasks such like CI & CD, releasing, etc.
admin_machine_users = {
}
# A map of GitHub users that should have admin permissions
admin_users = {
"[email protected]" = "alice"
"[email protected]" = "bob"
}
# A map of member machine users. These users are used by automation processes such as cloning repositories
member_machine_users = {
"[email protected]" = "acme-ci"
}
# A map of GitHub users that should have member permissions
member_users = {
"[email protected]" = "cOdewars1337",
"[email protected]" = "profundidaddeplagas",
"[email protected]" = "jenzcancode",
}
# We merge the maps of members and admins and pass them as arguments to the module
members = merge(
local.member_machine_users,
local.member_users
)
admins = merge(
local.admin_machine_users,
local.admin_users
)
}
module "organization" {
source = "mineiros-io/organization/github"
version = "0.1.0"
admins = values(local.admins)
members = values(local.members)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment