cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create Databricks SQL Endpoint using Terraform Clusters failing to launch

Olfa_Kamli
New Contributor III

Hi All 

I'm trying to create a Databricks SQL Endpoint using Terraform with the following resource configuration:

resource "databricks_sql_endpoint" "dataproduct_sql_endpoint" {
  provider                  = databricks.workspace
  name                      = local.sql_name
  cluster_size              = var.cluster_size
  max_num_clusters          = var.max_num_clusters
  min_num_clusters          = var.min_num_clusters
  auto_stop_mins            = var.auto_stop_mins
  enable_serverless_compute = true
}

I'm using a service principal that has the necessary permissions. Interestingly, I can successfully create the same SQL endpoint using the Databricks REST API, authenticated with the same service principal.

However, when attempting to create the endpoint via Terraform, I receive the following error:

Error: cannot create sql endpoint: failed waiting for warehouse to start: timed out: Clusters are failing to launch. Cluster launch will be retried.

I upgraded the Databricks provider version, but it's still not working

Does anyone know what might be causing the difference in behavior between the Terraform provider and direct API usage?

Any help would be appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions

Olfa_Kamli
New Contributor III

@SP_6721just a quick heads-up, this is all sorted now. Turns out the compute (warehouse) was just missing a tag. Added it, and everything started working as expected! Thank u !! 

View solution in original post

3 REPLIES 3

SP_6721
Contributor III

Hi @Olfa_Kamli ,

Terraform is usually stricter with how long it waits for resources to be ready, so it can time out faster than the REST API. You could try increasing the creation timeout in your Terraform config, as this might help give the warehouse enough time to start properly.

Olfa_Kamli
New Contributor III

Thank you for the quick response. However, even after adding the timeout attribute, the issue persists

----------------------------

Failing to start
Clusters are failing to launch. Cluster launch will be retried.

Request to create a cluster failed with an exception: INTERNAL_ERROR: Unexpected error occurred when trying to create cluster.

Olfa_Kamli
New Contributor III

@SP_6721just a quick heads-up, this is all sorted now. Turns out the compute (warehouse) was just missing a tag. Added it, and everything started working as expected! Thank u !! 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now