File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed
clusters/1_single_node_cluster
jobs/4_job_on_existing_cluster_with_new_notebooks Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,23 @@ locals {
33 cluster_name = var. cluster_name != null ? var. cluster_name : " ${ var . teamid } -${ var . prjid } (Terraform managed)"
44}
55
6+ resource "databricks_library" "maven" {
7+ for_each = try (var. libraries . maven , null ) != null ? var. libraries . maven : {}
8+
9+ cluster_id = databricks_cluster. cluster [local . cluster_name ]. id
10+ maven {
11+ coordinates = each. key
12+ exclusions = try (each. value . exclusion , [])
13+ }
14+ }
15+
16+ resource "databricks_library" "python_wheel" {
17+ for_each = try (var. libraries . python_wheel , null ) != null ? var. libraries . python_wheel : {}
18+
19+ cluster_id = databricks_cluster. cluster [local . cluster_name ]. id
20+ whl = each. key
21+ }
22+
623resource "databricks_cluster" "cluster" {
724 for_each = var. deploy_cluster == true ? toset ([local . cluster_name ]) : toset ([])
825
Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ module "databricks_workspace_management" {
1919 # ------------------------------------------------
2020 deploy_cluster = true
2121 fixed_value = 0
22+
23+ libraries = {
24+ maven = {
25+ " com.microsoft.azure:azure-eventhubs-spark_2.12:2.3.21" = {}
26+ }
27+ python_wheel = {}
28+ }
29+
2230 # ------------------------------------------------
2331 # Do not change the teamid, prjid once set.
2432 teamid = var. teamid
Original file line number Diff line number Diff line change @@ -15,11 +15,12 @@ terraform {
1515
1616module "databricks_workspace_management" {
1717 source = " ../../../"
18+
1819 # ------------------------------------------------
1920 # JOB
2021 # ------------------------------------------------
2122 deploy_jobs = true
22- cluster_id = " 0606-193951-30y13dr5 "
23+ cluster_id = " 0907-052446-bike152 "
2324 fixed_value = 1
2425 retry_on_timeout = false
2526 max_retries = 3
Original file line number Diff line number Diff line change @@ -358,3 +358,9 @@ variable "custom_tags" {
358358 description = " Extra custom tags"
359359 default = null
360360}
361+
362+ variable "libraries" {
363+ type = map (any )
364+ description = " Installs a library on databricks_cluster"
365+ default = {}
366+ }
You can’t perform that action at this time.
0 commit comments