terraform-provider-databricks
terraform-provider-databricks copied to clipboard
[ISSUE] Issue with `databricks_schema` resource - force_delete fails to delete models
Configuration
resource "databricks_catalog" "this" {
name = "force_destroy_test"
}
resource "databricks_schema" "this" {
name = "schema"
catalog_name = databricks_catalog.this.name
force_destroy = true
}
You also need to create a model and register a model version in the schema outside of Terraform.
Expected Behavior
- The
force_destroy
parameter should ensure that Terraform properly destroys every object within the schema before destroying the schema itself. - The Error message should indicate correctly what kinds of object still exist in the schema.
Actual Behavior
Terraform returns the following error which wrongly states that there is one function in the schema when there is only a model.
Error: cannot delete schema: Schema 'force_destroy_test.schema' is not empty. The schema has 0 tables(s), 1 functions(s), 0 volumes(s)
Steps to Reproduce
-
terraform apply
- Create a model and register a model version in the schema
-
terraform destroy
Terraform and provider versions
Terraform v1.7.5 on darwin_amd64
- provider registry.terraform.io/databricks/databricks v1.52.0
- provider registry.terraform.io/hashicorp/azurerm v3.116.0
Is it a regression?
Not sure.
Debug Output
https://gist.github.com/liahagan/dabc11e1070e8f9fe926df30c2f1b82e