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

[ISSUE] Incorrect diff for num_clusters in SQL Endpoint when endpoint is not running

Open ebarault opened this issue 3 years ago • 8 comments

Hi,

Configuration

 resource "databricks_sql_endpoint" "this" {
   name             = "Terraform-testing Endpoint"
   cluster_size     = "Large"
   min_num_clusters = 1
   max_num_clusters = 2
   auto_stop_mins   = 10
 }

Expected Behavior

No change on subsequent applies when endpoint is not running

Actual Behavior

image

Steps to reproduce

create the endpoint turn it off terraform apply again

Terraform and provider versions

provider 0.5.4

Notes

Already reported in https://github.com/databrickslabs/terraform-provider-databricks/issues/1116 with attached fix: https://github.com/databrickslabs/terraform-provider-databricks/pull/1117

however the fix does not seem to work

ebarault avatar Mar 18 '22 09:03 ebarault

an additional question @nfx is there a reason why the endpoint is started on creation ? I guess it is required to get some of the outputs. Same thing for clusters

ebarault avatar Mar 18 '22 10:03 ebarault

@ebarault exactly. also to verify that it's configuring properly.

nfx avatar Mar 18 '22 12:03 nfx

@shreyas-goenka the fix should include adding tf:"suppress_diff" type tag to the field in question. see instructions at https://github.com/databricks/terraform-provider-databricks/blob/master/CONTRIBUTING.md#adding-a-new-resource

nfx avatar Aug 08 '22 12:08 nfx

we really have suppress_diff for num_clusters: https://github.com/databricks/terraform-provider-databricks/blob/master/sql/resource_sql_endpoint.go#L30

alexott avatar Aug 08 '22 12:08 alexott

@alexott then it doesn't seem to work

nfx avatar Aug 11 '22 21:08 nfx

We face the same issue.

We tried to hardcode the number of clusters num_clusters = 1

Is it normal to check this variable when you specify a min and a max for the num of clusters?

mejnv avatar Aug 12 '22 06:08 mejnv

Following up - is this issue still relevant?

nfx avatar Aug 22 '22 09:08 nfx

I think so yes, there are two things we need to solve here:

  1. Figure out why suppress diff is not working for num_clusters.
  2. Do we want a consistent endpoint experience on create and update, ie on update, start the endpoint. This makes sense from infrastructure as a code POV since the num_clusters for the endpoint are specified and terraform should create those by starting the endpoint.

shreyas-goenka avatar Aug 22 '22 09:08 shreyas-goenka

Following up - is this issue still relevant?

nfx avatar Oct 13 '22 10:10 nfx

Running v1.5.0 I'm not able to re-create this anymore :+1: :shrug:

gpdenny avatar Oct 16 '22 11:10 gpdenny

We are using version 1.7.0 and getting this error.

ul400 avatar Dec 16 '22 09:12 ul400

This issue can be reproducible in 1.6.5 and 1.7.0 as well

manojhegde97 avatar Dec 19 '22 04:12 manojhegde97

We are also getting this error in 1.7.0

ePak avatar Jan 04 '23 05:01 ePak