Skip to content

Commit a0b39ed

Browse files
committed
updating files for azure
1 parent ed9ead6 commit a0b39ed

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed
File renamed without changes.

cluster.tf

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,29 @@ resource "databricks_cluster" "cluster" {
3737
}
3838
}
3939

40+
dynamic "azure_attributes" {
41+
for_each = var.azure_attributes == null ? [] : [var.azure_attributes]
42+
content {
43+
first_on_demand = lookup(azure_attributes.value, "first_on_demand", null)
44+
availability = lookup(azure_attributes.value, "availability", null)
45+
spot_bid_max_price = lookup(azure_attributes.value, "spot_bid_max_price", null)
46+
}
47+
}
48+
49+
dynamic "gcp_attributes" {
50+
for_each = var.gcp_attributes == null ? [] : [var.gcp_attributes]
51+
content {
52+
first_on_demand = lookup(gcp_attributes.value, "first_on_demand", null)
53+
availability = lookup(gcp_attributes.value, "availability", null)
54+
spot_bid_max_price = lookup(gcp_attributes.value, "spot_bid_max_price", null)
55+
}
56+
}
57+
4058
autotermination_minutes = var.cluster_autotermination_minutes
4159
custom_tags = var.fixed_value == 0 ? merge({ "ResourceClass" = "SingleNode" }, var.custom_tags) : var.custom_tags
4260

4361
spark_conf = var.fixed_value == 0 ? { "spark.databricks.cluster.profile" : "singleNode"
44-
"spark.master" : "local[*]" } : var.spark_conf
62+
"spark.master" : "local[*]" } : var.spark_conf
4563

4664
spark_env_vars = var.spark_env_vars
4765
}

examples/clusters/3_standard_cluster_with_auto_scaling/main.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ module "databricks_workspace_management" {
2020
# ------------------------------------------------
2121
deploy_cluster = true
2222

23-
fixed_value = 0
24-
#fixed_value = 5
25-
#auto_scaling = [3, 5]
23+
auto_scaling = [3, 5]
2624

2725
custom_tags = {
2826
"Application" : "DemoApp"

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ variable "aws_attributes" {
8484
default = null
8585
}
8686

87+
variable "azure_attributes" {
88+
description = "Optional configuration block contains attributes related to clusters running on Azure."
89+
type = any
90+
default = null
91+
}
92+
93+
variable "gcp_attributes" {
94+
description = "Optional configuration block contains attributes related to clusters running on GCP."
95+
type = any
96+
default = null
97+
}
98+
8799
variable "spark_env_vars" {
88100
description = "Map with environment variable key-value pairs to fine-tune Spark clusters. Key-value pairs of the form (X,Y) are exported (i.e., X='Y') while launching the driver and workers."
89101
type = any

0 commit comments

Comments
 (0)