-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
44 lines (35 loc) · 1.08 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
terraform {
required_version = "~> 0.13.0"
backend "remote" {
organization = "VoxPupuli"
workspaces {
name = "github-secpupuli"
}
}
}
provider "github" {
version = "~> 2.9.2"
organization = "secpupuli"
token = var.github_token
}
resource "github_membership" "owner" {
for_each = toset(concat(var.pmc_members, var.non_pmc_admins))
username = each.key
role = "admin"
}
resource "github_team" "terraform_admins" {
name = "Terraform Admins"
description = "Team members can modify the terraform that controls Vox infrastructure"
}
resource "github_team_membership" "terraform_admin_member" {
for_each = toset(concat(var.pmc_members, var.non_pmc_admins))
team_id = github_team.terraform_admins.id
username = each.key
role = "maintainer" # If you try to set 'member', github will promote us back to maintainers as we're already repo owners
}
module "terraform_git_repo" {
for_each = toset(var.terraform_repos)
source = "./terraform_git_repo"
repo_name = each.key
team_slug = github_team.terraform_admins.slug
}