This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathiam.tf
143 lines (119 loc) · 5.07 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
resource "google_service_account" "cloudsql_proxy" {
project = "${var.project}"
account_id = "${var.cluster_name}-cloudsqlproxy-sa"
display_name = "Service account for ${var.cluster_name} to connect to cloudsql"
}
resource "google_service_account" "kubeflow_user" {
project = "${var.project}"
account_id = "${var.cluster_name}-user-sa"
display_name = "User account for ${var.cluster_name}"
}
resource "google_service_account" "kubeflow_vm" {
project = "${var.project}"
account_id = "${var.cluster_name}-vm-sa"
display_name = "VM (GKE node) service account for ${var.cluster_name}"
}
resource "google_service_account" "kubeflow_admin" {
project = "${var.project}"
account_id = "${var.cluster_name}-admin-sa"
display_name = "Admin account for ${var.cluster_name}"
}
resource "google_project_iam_member" "kubeflow_admin-source_admin" {
project = "${var.project}"
role = "roles/source.admin"
member = "serviceAccount:${google_service_account.kubeflow_admin.email}"
}
resource "google_project_iam_member" "kubeflow_admin-servicemanagement-admin" {
project = "${var.project}"
role = "roles/servicemanagement.admin"
member = "serviceAccount:${google_service_account.kubeflow_admin.email}"
}
resource "google_project_iam_member" "kubeflow_admin-compute_networkadmin" {
project = "${var.project}"
role = "roles/compute.networkAdmin"
member = "serviceAccount:${google_service_account.kubeflow_admin.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-cloudbuild_builds_editor" {
project = "${var.project}"
role = "roles/cloudbuild.builds.editor"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-viewer" {
project = "${var.project}"
role = "roles/viewer"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-source_admin" {
project = "${var.project}"
role = "roles/source.admin"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-storage_admin" {
project = "${var.project}"
role = "roles/storage.admin"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-bigquery_admin" {
project = "${var.project}"
role = "roles/bigquery.admin"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-dataflow_admin" {
project = "${var.project}"
role = "roles/dataflow.admin"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-ml_admin" {
project = "${var.project}"
role = "roles/ml.admin"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-dataproc_editor" {
project = "${var.project}"
role = "roles/dataproc.editor"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_user-compute-cloudsql_admin" {
project = "${var.project}"
role = "roles/cloudsql.admin"
member = "serviceAccount:${google_service_account.kubeflow_user.email}"
}
resource "google_project_iam_member" "kubeflow_vm-compute-logging_logwriter" {
project = "${var.project}"
role = "roles/logging.logWriter"
member = "serviceAccount:${google_service_account.kubeflow_vm.email}"
}
resource "google_project_iam_member" "kubeflow_vm-compute-monitoring_metricwriter" {
project = "${var.project}"
role = "roles/monitoring.metricWriter"
member = "serviceAccount:${google_service_account.kubeflow_vm.email}"
}
resource "google_project_iam_member" "kubeflow_vm-compute-storage_objectviewer" {
project = "${var.project}"
role = "roles/storage.objectViewer"
member = "serviceAccount:${google_service_account.kubeflow_vm.email}"
}
resource "google_project_iam_member" "cloudsql_proxy-cloudsql_admin" {
project = "${var.project}"
role = "roles/cloudsql.admin"
member = "serviceAccount:${google_service_account.cloudsql_proxy.email}"
}
resource "google_project_iam_member" "cloudsql_proxy-cloudsql_editor" {
project = "${var.project}"
role = "roles/cloudsql.editor"
member = "serviceAccount:${google_service_account.cloudsql_proxy.email}"
}
resource "google_project_iam_member" "cloudsql_proxy-cloudsql_client" {
project = "${var.project}"
role = "roles/cloudsql.client"
member = "serviceAccount:${google_service_account.cloudsql_proxy.email}"
}
resource "google_service_account_key" "cloudsql_proxy_key" {
service_account_id = "${google_service_account.cloudsql_proxy.name}"
}
resource "google_service_account_key" "kubeflow_admin_key" {
service_account_id = "${google_service_account.kubeflow_admin.name}"
}
resource "google_service_account_key" "kubeflow_user_key" {
service_account_id = "${google_service_account.kubeflow_user.name}"
}