databricks / terraform-provider-databricks

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

[ISSUE] Issue with foreign `databricks_catalog` isolation mode #2820

Closed jacovg91 closed 10 months ago

jacovg91 commented 10 months ago

Hello,

the databricks_catalog catalog resource when set to a connection_name (so a foreign catalog) can not set the isolation mode correctly.

By default it is open, but if i set it to isolated, it will give me: cannot update catalog: UpdateCatalog options can not be provided

Configuration

resource "databricks_connection" "sql_server" {
  provider        = databricks.workspace
  name            = "con123"
  connection_type = "SQLSERVER"
  #owner           = var.ad_group_principal_name currently does not work, need to set it manually (https://github.com/databricks/terraform-provider-databricks/issues/2743)
  comment = "comment"
  options = {
    host     = "hostname"
    port     = "1433"
    user     = "user"
    password = "pass"
  }
  properties = {
    purpose = "Azure SQL Lakehouse Federation"
  }
}

resource "databricks_catalog" "foreign_sql_catalog" {
  provider        = databricks.workspace
  metastore_id    = var.databricks_metastore_id
  name            = "sql_catalog"
  comment         = "comment"
  isolation_mode  = "ISOLATED"
  connection_name = databricks_connection.sql_server.name
  properties = {
    purpose = "foo"
  }
  options = {
    database = "db"
  }
}

Expected Behavior

The catalog should have been created with isolation set to the workspace it was created with. According to the docs: Setting the catalog to ISOLATED will automatically allow access from the current workspace. Btw, this works fine on regular catalogs, just not on foreign ones.

Actual Behavior

Getting: cannot update catalog: UpdateCatalog options can not be provided

Steps to Reproduce

Terraform and provider versions

Debug Output

Important Factoids

nkvuong commented 10 months ago

@jacovg91 which provider version are you using? the latest one should fix it already

jacovg91 commented 10 months ago

@nkvuong ah good you mention it, i'm using 1.27. Didn't see anything about this in the release notes though?

jacovg91 commented 10 months ago

can confirm, 1.28.1 solves it. closing ticket thanks @nkvuong