databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
424 stars 366 forks source link

[ISSUE] Issue with `databricks_catalog_workspace_binding` resource - BINDING is not recreated when external_catalog is recreated #3306

Open VOVELEE opened 4 months ago

VOVELEE commented 4 months ago

Configuration

Expected Behavior

 module.solutions.databricks_catalog.external["ext_monitoring"] must be replaced
-/+ resource "databricks_catalog" "external" {
      ~ connection_name = "old-connection" -> "new-connection" # forces replacement
      ~ id              = "ext_monitoring" -> (known after apply)
        name            = "ext_monitoring"
        # (5 unchanged attributes hidden)
    }

  # module.solutions.databricks_catalog_workspace_binding.external-default["ext_monitoring"] must be replaced
-/+ resource "databricks_catalog_workspace_binding" "external-default" {
      ~ id             = "777665544332211|catalog|ext_monitoring" # forces replacement
        # (3 unchanged attributes hidden)
    }

Actual Behavior

 module.solutions.databricks_catalog.external["ext_monitoring"] must be replaced
-/+ resource "databricks_catalog" "external" {
      ~ connection_name = "old-connection" -> "new-connection" # forces replacement
      ~ id              = "ext_monitoring" -> (known after apply)
        name            = "ext_monitoring"
        # (5 unchanged attributes hidden)
    }

nothing for workspace bindings

Steps to Reproduce

See Configuration

Terraform and provider versions

Is it a regression?

I don't know.

Debug Output

See above

Important Factoids

Would you like to implement a fix?

-

nkvuong commented 3 months ago

@VOVELEE I suspect this is to do with how you are specifying the catalog in the catalog_workspace_binding - you should refer to a databricks_catalog attribute, rather than a var, otherwise TF would not understand the dependencies and won't re-create the resources accordingly