-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
59 lines (50 loc) · 1.31 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
resource "github_membership" "maintainers" {
for_each = toset(var.maintainers)
username = each.key
role = "member"
}
resource "github_team_membership" "maintainers" {
for_each = toset(compact(distinct(concat(var.maintainers, var.board))))
username = each.key
team_id = github_team.maintainers.id
}
resource "github_team" "maintainers" {
name = "maintainers"
description = "${var.organization} Maintainers"
privacy = "closed"
}
resource "github_membership" "board" {
for_each = toset(var.board)
username = each.key
role = "admin"
}
resource "github_team_membership" "board" {
for_each = toset(var.board)
username = each.key
team_id = github_team.board.id
role = "maintainer"
}
resource "github_team" "board" {
name = "board"
description = "${var.organization} Board"
privacy = "closed"
}
# Kitchen Porter is not added to this list on purpose
resource "github_membership" "bots" {
for_each = toset(var.bots)
username = each.key
role = "member"
}
resource "github_team_membership" "bots" {
for_each = toset(var.bots)
username = each.key
team_id = github_team.bots.id
}
resource "github_team" "bots" {
name = "bots"
description = "${var.organization} Bots"
privacy = "closed"
}
variable "organization" {
default = "sous-chefs"
}