databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
424 stars 366 forks source link

[ISSUE] Issue with `databricks_sql_endpoint` resource export #3488

Open TravBricks opened 2 months ago

TravBricks commented 2 months ago
  1. SQL warehouse names with parenthesis in them get removed in the export
  2. Exported SQL endpoints do not include the enable_serverless_compute flag

Configuration

resource "databricks_sql_endpoint" "serverless_warehouse" {
  warehouse_type = "PRO"
  enable_serverless_compute = true
  tags {
    custom_tags {
      value = "Business Analytics"
      key   = "Purpose"
    }
  }
  name             = "Terraform Notebook Simple Example (serverless)"
  min_num_clusters = 1
  max_num_clusters = 2
  cluster_size     = "2X-Small"
  auto_stop_mins   = 10
}

resource "databricks_sql_endpoint" "pro_warehouse" {
  warehouse_type = "PRO"
  enable_serverless_compute = false
  tags {
    custom_tags {
      value = "Business Analytics"
      key   = "Purpose"
    }
  }
  name             = "Terraform Notebook Simple Example (pro)"
  min_num_clusters = 1
  max_num_clusters = 2
  cluster_size     = "2X-Small"
  auto_stop_mins   = 10
}

Expected Behavior

Two SQL endpoints in the sql-endpoints.tf file that include the enable_serverless_compute flag

Actual Behavior

A single SQL endpoint, the part of the name in parenthesis is missing and there is no enable_serverless_compute flag that means with a default of true and the warehouse_type argument set to PRO. This will be a serverless warehouse.

Steps to Reproduce

  1. terraform apply with my hcl example above
  2. Run exporter with no arguments, look at the sql-endpoints.tf for output

Terraform and provider versions

Terraform v1.8.1 Databricks provider v1.39

Is it a regression?

Possibly, I did not test before. The default behavior for enable_serverless_compute has changed from false to true.

Debug Output

I can provide access to an internal ADB workspace and notebook where testing was done.

TravBricks commented 2 months ago

I confirmed the full name with parenthesis and enable_serverless_compute are emitted by the /api/2.0/sql/warehouses API endpoint. image