terraform-provider-databricks
terraform-provider-databricks copied to clipboard
[ISSUE] Issue with `databricks_instance_pool` resource - max_capacity can't be unset
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
- terraform apply with max capacity > 0 - this sets the proper pool max instance count
- change max_capacity to 0 or null or delete max_capacity altogether
- 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.
there is suppress_diff on max_capacity, this is introduced in #1074 to fix #984. @nfx what's your thought on this
@nkvuong i think it's easier to mark this as wontfix for now.
@ljankows can you re-create the resource as a workaround?
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.