-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
43 lines (33 loc) · 1.06 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
module "iam_groups" {
source = "./modules/iam_groups"
}
module "iam_admin_users" {
source = "./modules/iam_users"
usernames = var.admins_emails
}
module "iam_developer_users" {
source = "./modules/iam_users"
usernames = var.developers_emails
}
module "iam_infra_service_account_users" {
source = "./modules/iam_users"
usernames = var.infra_service_accounts_emails
has_login = false
}
module "iam_group_membership" {
source = "./modules/iam_group_membership"
for_each = {
admin = { group = module.iam_groups.admin_group, users = var.admins_emails },
infra_service_account = { group = module.iam_groups.infra_service_account_group, users = var.infra_service_accounts_emails },
developer = { group = module.iam_groups.developer_group, users = var.developers_emails }
}
name = "${each.key}-group-membership"
group = each.value.group
users = each.value.users
depends_on = [
module.iam_groups,
module.iam_admin_users,
module.iam_developer_users,
module.iam_infra_service_account_users,
]
}