-
Notifications
You must be signed in to change notification settings - Fork 16
/
iam.tf
54 lines (44 loc) · 2.14 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
resource "google_service_account" "pks_master_node_service_account" {
account_id = "${var.env_prefix}-pks-master-node"
display_name = "${var.env_prefix} PKS Master Node Service Account"
}
resource "google_service_account_key" "pks_master_node_service_account_key" {
service_account_id = "${google_service_account.pks_master_node_service_account.id}"
}
resource "google_service_account" "pks_worker_node_service_account" {
account_id = "${var.env_prefix}-pks-worker-node"
display_name = "${var.env_prefix} PKS Worker Node Service Account"
}
resource "google_service_account_key" "pks_worker_node_service_account_key" {
service_account_id = "${google_service_account.pks_worker_node_service_account.id}"
}
resource "google_project_iam_member" "pks_master_node_compute_instance_admin" {
project = "${var.project}"
role = "roles/compute.instanceAdmin"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}
resource "google_project_iam_member" "pks_master_node_compute_network_admin" {
project = "${var.project}"
role = "roles/compute.networkAdmin"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}
resource "google_project_iam_member" "pks_master_node_compute_storage_admin" {
project = "${var.project}"
role = "roles/compute.storageAdmin"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}
resource "google_project_iam_member" "pks_master_node_compute_security_admin" {
project = "${var.project}"
role = "roles/compute.securityAdmin"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}
resource "google_project_iam_member" "pks_master_node_iam_service_account_actor" {
project = "${var.project}"
role = "roles/iam.serviceAccountActor"
member = "serviceAccount:${google_service_account.pks_master_node_service_account.email}"
}
resource "google_project_iam_member" "pks_worker_node_compute_viewer" {
project = "${var.project}"
role = "roles/compute.viewer"
member = "serviceAccount:${google_service_account.pks_worker_node_service_account.email}"
}