Skip to content

[ISSUE] databricks_workspace_binding resource is replacing the current bind of catalog resource for current workspaceΒ #5300

@devlucasc

Description

@devlucasc

Configuration

resource "databricks_catalog" "sandbox" {
  name           = "sandbox"
  isolation_mode = "ISOLATED"
}

resource "databricks_workspace_binding" "sandbox" {
  securable_name = databricks_catalog.sandbox.name
  workspace_id   = databricks_mws_workspaces.current.workspace_id
}

Expected Behavior

I have some ideas:

  • When ISOLATED, do not bind automatically, let the user declare the bind resource explicit
  • Or, when workspace binding resource is declared together with the main resource, make it fail to avoid replacing the current bind as well and update the documentation to explain that is not necessary to set workspace binding to the current workspace when isolation_mode is ISOLATED.

Actual Behavior

When creating catalog with isolation mode as ISOLATED, this resource automatically will bind the catalog to the current workspace. If set a databricks_workspace_binding resource pointing to the current workspace, the binding will be replaced by this resource and the state will be controlled by terraform. When destroy is executed, the binding resource will be removed before the catalog removal. In this case, the catalog will not be accessible in the current workspace anymore and then the destroy will fail.

Steps to Reproduce

  1. terraform apply
  2. terraform destroy

Terraform and provider versions

Terraform 1.7.5
Provider 1.97.0

Is it a regression?

No, it isn't

Debug Output

Important Factoids

Would you like to implement a fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions