forked from jetvova/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__main__.py
62 lines (55 loc) · 1.59 KB
/
__main__.py
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
from pulumi import Config, export
from pulumi_azure import core, storage, hdinsight
config = Config()
username = config.require("username")
password = config.require_secret("password")
resource_group = core.ResourceGroup("spark-rg")
storage_account = storage.Account(
"sparksa",
resource_group_name=resource_group.name,
account_replication_type="LRS",
account_tier="Standard")
storage_container = storage.Container(
"spark",
storage_account_name=storage_account.name,
container_access_type="private")
spark_cluster = hdinsight.SparkCluster(
"myspark",
resource_group_name=resource_group.name,
cluster_version="3.6",
component_version={
"spark": "2.3"
},
tier="Standard",
storage_accounts=[{
"is_default": "true",
"storage_account_key": storage_account.primary_access_key,
"storage_container_id": storage_container.id
}],
gateway={
"enabled": "true",
"username": username,
"password": password
},
roles={
"head_node": {
"vm_size": "Standard_D12_v2",
"username": username,
"password": password
},
"worker_node": {
"vm_size": "Standard_D12_v2",
"username": username,
"password": password,
"target_instance_count": "3",
},
"zookeeper_node": {
"vm_size": "Standard_D12_v2",
"username": username,
"password": password
}
}
)
export("endpoint", spark_cluster.https_endpoint.apply(
lambda endpoint: "https://" + endpoint
))