-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathservice-account.tf
33 lines (29 loc) · 968 Bytes
/
service-account.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
# https://cloud.yandex.ru/docs/iam/concepts/users/service-accounts
resource "yandex_iam_service_account" "default" {
name = var.project_name
description = "Service account for DataProc"
}
resource "yandex_resourcemanager_folder_iam_binding" "dataprocagent" {
folder_id = var.yc_folder_id
role = "dataproc.agent"
members = [
"serviceAccount:${yandex_iam_service_account.default.id}"
]
}
resource "yandex_resourcemanager_folder_iam_binding" "dataproc" {
folder_id = var.yc_folder_id
role = "mdb.dataproc.agent"
members = [
"serviceAccount:${yandex_iam_service_account.default.id}"
]
}
resource "yandex_resourcemanager_folder_iam_binding" "bucket-creator" {
folder_id = var.yc_folder_id
role = "editor"
members = [
"serviceAccount:${yandex_iam_service_account.default.id}"
]
}
resource "yandex_iam_service_account_static_access_key" "default" {
service_account_id = yandex_iam_service_account.default.id
}