-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabricks.tf
70 lines (60 loc) · 1.7 KB
/
databricks.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
terraform {
required_providers {
databricks = {
source = "databrickslabs/databricks"
version = "0.2.5"
}
}
}
provider "databricks" {
azure_workspace_resource_id = azurerm_databricks_workspace.adb.id
}
resource "databricks_cluster" "default" {
cluster_name = "Default Cluster"
spark_version = "6.6.x-scala2.11"
node_type_id = "Standard_DS3_v2"
autotermination_minutes = 20
autoscale {
min_workers = 1
max_workers = 10
}
library {
maven {
coordinates = "org.apache.hbase.connectors.spark:hbase-spark:1.0.0"
}
}
library {
maven {
coordinates = "org.apache.hbase:hbase-common:2.3.1"
}
}
library {
maven {
coordinates = "org.apache.hbase:hbase-server:2.3.1"
}
}
}
resource "databricks_secret_scope" "terraform" {
name = "terraform"
initial_manage_principal = "users"
}
resource "databricks_secret" "storage_key" {
key = "blob_storage_key"
string_value = azurerm_storage_account.blob.primary_access_key
scope = databricks_secret_scope.terraform.name
}
resource "databricks_azure_blob_mount" "hdi" {
container_name = azurerm_storage_container.hdi.name
storage_account_name = azurerm_storage_account.blob.name
mount_name = "hdi"
auth_type = "ACCESS_KEY"
token_secret_scope = databricks_secret_scope.terraform.name
token_secret_key = databricks_secret.storage_key.key
cluster_id = databricks_cluster.default.id
}
resource "databricks_notebook" "test_hbase" {
content = filebase64("${path.module}/TestHBase.scala")
path = "/Shared/TestHBase.scala"
overwrite = true
language = "SCALA"
}