-
Notifications
You must be signed in to change notification settings - Fork 1
/
iam.tf
31 lines (27 loc) · 1 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
resource "google_service_account" "nomad" {
account_id = "nomad-agent"
project = var.project
}
# Allow nomad to see other GCE instances
resource "google_project_iam_member" "nomad_compute_viewer" {
project = var.project
role = "roles/compute.viewer"
member = "serviceAccount:${google_service_account.nomad.email}"
}
# Allow nomad to read/write GCE disks
resource "google_project_iam_member" "nomad_compute_instance_admin_v1" {
project = var.project
role = "roles/compute.instanceAdmin.v1"
member = "serviceAccount:${google_service_account.nomad.email}"
}
resource "google_project_iam_member" "nomad_compute_service_account_user" {
project = var.project
role = "roles/iam.serviceAccountUser"
member = "serviceAccount:${google_service_account.nomad.email}"
}
# Allow nomad to read/write GCS buckets
resource "google_project_iam_member" "nomad_storage_admin" {
project = var.project
role = "roles/storage.admin"
member = "serviceAccount:${google_service_account.nomad.email}"
}