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

[ISSUE] Issue with `databricks_instance_pool` resource - max_capacity can't be unset

Open ljankows opened this issue 3 years ago • 3 comments
trafficstars

Configuration

resource "databricks_instance_pool" "driver" {
  instance_pool_name                    = "driver-pool"
  min_idle_instances                    = 0
  max_capacity                          = 100
  node_type_id                          = var.adb_cluster_driver_pool_tier
  idle_instance_autotermination_minutes = 60

  azure_attributes {
    availability = "ON_DEMAND_AZURE"
  }
}

Expected Behavior

the max_capacity gets unset

Actual Behavior

the max_capacity gets ignored if value not greater than 1, basically plan/apply shows no change

Steps to Reproduce

  1. terraform apply with max capacity > 0 - this sets the proper pool max instance count
  2. change max_capacity to 0 or null or delete max_capacity altogether
  3. terraform apply again - this ignores the change, like it would never existed, even if the state and UI still shows the old value.

Terraform and provider versions

Databricks provider 1.2.1 Terraform version 1.2.9 on linux_amd64

Important Factoids

Found in Azure.

When manually inspecting the state file, the max_capacity does still exist there with the non-zero value. Suspect the provider has an invalid logic, which skips all the checks if value is 0/null.

ljankows avatar Sep 09 '22 13:09 ljankows

there is suppress_diff on max_capacity, this is introduced in #1074 to fix #984. @nfx what's your thought on this

nkvuong avatar Sep 09 '22 14:09 nkvuong

@nkvuong i think it's easier to mark this as wontfix for now.

@ljankows can you re-create the resource as a workaround?

nfx avatar Sep 09 '22 17:09 nfx

not really, those are our production clusters. If you won't fix the issue, then the only workaround is to manually verify and change (or add arbitrary script). I'd rather have the TF provider to be able to handle this basic case.

ljankows avatar Sep 12 '22 11:09 ljankows