Check Databricks Cluster GCP Attribute Best Practices

  • Query id: 539e4557-d2b5-4d57-a001-cb01140a4e2d
  • Query name: Check Databricks Cluster GCP Attribute Best Practices
  • Platform: Terraform
  • Severity: Medium
  • Category: Best Practices
  • URL: Github

Description

One or some Databricks Cluster GCP Attribute Best Practices are not respected
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - tf file
resource "databricks_cluster" "positive" {
  cluster_name            = "data"
  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
  }
  gcp_attributes {
    availability           = "PREEMPTIBLE_GCP"
    zone_id                = "AUTO"
  }
}

Code samples without security vulnerabilities

Negative test num. 1 - tf file
resource "databricks_cluster" "negative" {
  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
  }
  gcp_attributes {
    availability           = "PREEMPTIBLE_WITH_FALLBACK_GCP"
    zone_id                = "auto"
    first_on_demand        = 1
    spot_bid_price_percent = 100
  }
}