forked from UKHomeOffice/ccoe-module-github
-
Notifications
You must be signed in to change notification settings - Fork 1
/
teams.tf
33 lines (26 loc) · 881 Bytes
/
teams.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
# *********************************************************
# TEAMS
# *********************************************************
# ---------------------------------------------------------
# Create Teams
# ---------------------------------------------------------
resource "github_team" "team" {
for_each = var.teams
name = each.value.name
description = each.value.description
privacy = each.value.privacy
}
# ---------------------------------------------------------
# Add Team Members
# ---------------------------------------------------------
resource "github_team_members" "team-members" {
for_each = { for k, v in var.teams : k => v if length(v.members) > 0 }
team_id = github_team.team[each.key].id
dynamic "members" {
for_each = each.value.members
content {
username = members.key
role = members.value.role
}
}
}