Databricks autoscaling bounds are incomplete

Specify both the minimum and maximum worker counts for Databricks autoscaling.

Description

In a Databricks cluster’s autoscale block, min_workers sets the initial and minimum worker count. max_workers sets the upper limit.

Potential impact

An incomplete range can prevent deployment. A low ceiling can limit performance, and a high ceiling can increase costs.

Remediation

Set both values for the workload and budget. Set max_workers higher than min_workers.

Examples

The first excerpt omits the maximum. The second sets a range of 1–50 workers. The runtime and node-type data sources are omitted.

Before

hcl
resource "databricks_cluster" "example" {
  cluster_name            = "Shared Autoscaling"
  spark_version           = data.databricks_spark_version.latest.id
  node_type_id            = data.databricks_node_type.smallest.id
  autotermination_minutes = 20

  autoscale {
    min_workers = 1
  }
}

After

hcl
resource "databricks_cluster" "example" {
  cluster_name            = "Shared Autoscaling"
  spark_version           = data.databricks_spark_version.latest.id
  node_type_id            = data.databricks_node_type.smallest.id
  autotermination_minutes = 20

  autoscale {
    min_workers = 1
    max_workers = 50
  }
}

References