-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
74 lines (67 loc) · 1.82 KB
/
main.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
terraform {
required_providers {
yandex = {
source = "yandex-cloud/yandex"
}
}
required_version = ">= 0.13"
}
provider "yandex" {
token = var.yc_token
cloud_id = var.yc_cloud_id
folder_id = var.yc_folder_id
zone = var.yc_zone
}
# https://cloud.yandex.ru/docs/data-proc/operations/cluster-create
resource "yandex_dataproc_cluster" "default" {
bucket = "default"
name = var.project_name
description = var.project_name
service_account_id = yandex_iam_service_account.default.id
zone_id = join(".", ["yandex_dns_zone", var.yc_zone, "id"] )
# security_group_ids = beta
deletion_protection = false
cluster_config {
version_id = var.dataproc_version
hadoop {
services = ["HDFS", "YARN", "SPARK", "TEZ", "MAPREDUCE", "HIVE"]
properties = { }
ssh_public_keys = [
file("~/.ssh/id_rsa.pub")
]
}
subcluster_spec {
name = "MASTERNODE"
role = "MASTERNODE"
resources {
resource_preset_id = "s2.small"
disk_type_id = "network-ssd-nonreplicated"
disk_size = 128
}
subnet_id = yandex_vpc_network.default.id
hosts_count = 1
}
subcluster_spec {
name = "DATANODE"
role = "DATANODE"
resources {
resource_preset_id = "s2.small"
disk_type_id = "network-ssd-nonreplicated"
disk_size = 128
}
subnet_id = yandex_vpc_network.default.id
hosts_count = 1
}
subcluster_spec {
name = "COMPUTENODE"
role = "COMPUTENODE"
resources {
resource_preset_id = "s2.small"
disk_type_id = "network-ssd-nonreplicated"
disk_size = 128
}
subnet_id = yandex_vpc_network.default.id
hosts_count = 1
}
}
}