terraform-provider-databricks
terraform-provider-databricks copied to clipboard
[ISSUE] Issue with `databricks_grants` resource
trafficstars
Configuration
resource "databricks_catalog" "customer" {
name = "catalog_name_new"
comment = "The renamed catalog"
isolation_mode = "ISOLATED"
owner = data.databricks_service_principal.spn.application_id
storage_root = databricks_external_location.workspace.url
}
# Example Databricks group to be granted access to the catalog
resource "databricks_group" "this" {
display_name = "example-data-analysts"
}
# Grant catalog-level privileges to the group
resource "databricks_grants" "catalog_customer" {
catalog = databricks_catalog.customer.name
grant {
principal = databricks_group.this.display_name
privileges = [
"USE_CATALOG",
"USE_SCHEMA",
"SELECT",
"APPLY_TAG",
"BROWSE"
]
}
depends_on = [databricks_catalog.customer]
}
Expected Behavior
After renaming a catalog the grants are applied on the renamed catalog.
Actual Behavior
The apply errors with an inconsisten final plan:
╷ │ Error: Provider produced inconsistent final plan │ │ When expanding the plan for │ module.databricks_cluster.databricks_grants.customer to include new │ values learned so far during apply, provider │ "registry.terraform.io/databricks/databricks" produced an invalid new value │ for .catalog: was cty.StringVal("catalog_name_new"), but now │ cty.StringVal("catalog_name_old"). │ │ This is a bug in the provider, which should be reported in the provider's │ own issue tracker.
Steps to Reproduce
terraform applywith another catalog name- rename the catalog
terraform apply
Terraform and provider versions
Terraform v1.9.8 on darwin_arm64
- provider registry.terraform.io/databricks/databricks v1.74.0
Is it a regression?
No it did not work on an older version.
Important Factoids
No
Would you like to implement a fix?
I do not plan on implementing a fix.