-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
32 lines (30 loc) · 987 Bytes
/
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
provider "google" {
project = var.project
region = var.region
}
provider "google-beta" {
project = var.project
region = var.region
}
module "service-accounts" {
for_each = {
id = {
roles : [
"roles/logging.logWriter",
"roles/monitoring.metricWriter",
"roles/stackdriver.resourceMetadata.writer",
"roles/artifactregistry.reader",
"roles/iam.serviceAccountTokenCreator"
],
workload-identities : []
}
dev = { roles : ["roles/iam.serviceAccountTokenCreator"], workload-identities : [] }
github-actions = { roles : [], workload-identities : [] }
external-dns = { roles : ["roles/dns.admin"], workload-identities : ["external-dns/external-dns"] }
}
source = "./modules/service_accounts"
account = "${var.base}-${each.key}"
project = var.project
roles = each.value.roles
workload-identities = each.value.workload-identities
}