terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

[ISSUE] Issue with `databricks_sql_endpoint` resource while setting up auto_stop_mins to 0, fails

Open kunaljadhav-db opened this issue 1 year ago • 2 comments

#As per the resource documents setting up the auto_stop_mins to 0 should disable the auto stop but it is set to 10 min. Also, as per the state file, the warehouse type is shown as a Pro, but in UI, it is serverless.

Configuration

terraform {
  required_providers {
    databricks = {
      source  = "databricks/databricks"
      version = "1.47.0"
    }
  }
}
provider "databricks" { 
}
resource "databricks_sql_endpoint" "this" {
  name             = "Endpoint of from TF2"
  cluster_size     = "Small"
  max_num_clusters = 1
  auto_stop_mins = 0

  tags {
    custom_tags {
      key   = "City"
      value = "Amsterdam"
    }
  }
}

Expected Behavior

auto_stop_mins = 0 should disable the auto stop

Actual Behavior

auto_stop_mins is set to 10 min

Steps to Reproduce

Use above resource and try terraform apply with latest version and it will fail to disable auto stop in endpoint config.

Terraform and provider versions

databricks/databricks 1.47.0

Is it a regression?

Not sure.

Debug Output

the issue can be reproduced consistently; hence, I did not attach the debug logs. But here is the state file looks like: { "version": 4, "terraform_version": "1.3.9", "serial": 1, "lineage": "31c25035-39b8-800e-dde8-33b635292ef3", "outputs": {}, "resources": [ { "mode": "managed", "type": "databricks_sql_endpoint", "name": "this", "provider": "provider["registry.terraform.io/databricks/databricks"]", "instances": [ { "schema_version": 0, "attributes": { "auto_stop_mins": 10, "channel": [], "cluster_size": "Small", "creator_name": "#", "data_source_id": "##", "enable_photon": true, "enable_serverless_compute": true, "health": [ { "details": "", "failure_reason": [], "message": "", "status": "HEALTHY", "summary": "" } ], "id": "6e627855071bf0e5", "instance_profile_arn": null, "jdbc_url": "jdbc:spark://###;", "max_num_clusters": 1, "min_num_clusters": 1, "name": "Endpoint of from TF2", "num_active_sessions": 0, "num_clusters": 1, "odbc_params": [ { "hostname": "##.cloud.databricks.com", "path": "/sql/1.0/warehouses/##", "port": 443, "protocol": "https" } ], "spot_instance_policy": "COST_OPTIMIZED", "state": "RUNNING", "tags": [ { "custom_tags": [ { "key": "City", "value": "Amsterdam" } ] } ], "timeouts": null, "warehouse_type": "PRO" }, "sensitive_attributes": [], "private": "###" } ] } ], "check_results": null }

kunaljadhav-db avatar Jun 24 '24 04:06 kunaljadhav-db

We just experienced this as well in provider version 1.51.0.

Output of plan: image

Output of apply: image

In the UI (after apply): image

So no changes are actually applied to the workspace

jpm-halfspace avatar Sep 03 '24 08:09 jpm-halfspace

Same issue with version = "1.51.0" as well. If auto_stop_mins changed to any value other than 0, changes are reflected. But if it is updated to 0, no changes are applied.

amitysa avatar Sep 27 '24 09:09 amitysa

This has been fixed (for me) by #4265, which was released in v1.60.0. I needed to upgrade the provider, set auto_stop_mins to a valid, non-zero value, apply the change, and then set auto_stop_mins to 0.

gabriellesc avatar Jan 30 '25 21:01 gabriellesc

Closing as it's reported to be closed by #4265

alexott avatar Jan 31 '25 07:01 alexott