-
Notifications
You must be signed in to change notification settings - Fork 487
/
iam.tf
34 lines (25 loc) · 1.06 KB
/
iam.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
locals {
cloud_build_member = "serviceAccount:${google_project.project.number}@cloudbuild.gserviceaccount.com"
compute_account = "projects/${var.project}/serviceAccounts/${google_project.project.number}[email protected]"
}
resource "google_project_iam_member" "firebase_admin" {
role = "roles/firebase.admin"
member = local.cloud_build_member
depends_on = [google_project_service.cloud_build]
}
resource "google_project_iam_member" "api_keys_admin" {
role = "roles/serviceusage.apiKeysViewer"
member = local.cloud_build_member
depends_on = [google_project_service.cloud_build]
}
resource "google_project_iam_member" "cloud_run_admin" {
role = "roles/run.admin"
member = local.cloud_build_member
depends_on = [google_project_service.cloud_build]
}
resource "google_service_account_iam_member" "default-compute-account" {
service_account_id = local.compute_account
role = "roles/iam.serviceAccountUser"
member = local.cloud_build_member
depends_on = [google_project_service.cloud_build]
}