databricks / terraform-provider-databricks

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

[ISSUE] Issue with `databricks_service_principal` resource #3912

Open mariohoxha42 opened 2 months ago

mariohoxha42 commented 2 months ago

Configuration

provider "databricks" {
  account_id    = var.databricks_account_id
  host          = var.databricks_host_url
  client_id     = var.client_id
  client_secret = var.client_secret
}

/* Previous configuration */
resource "databricks_service_principal" "common-sp" {
  provider              = databricks
  display_name          = "Common SP"
  databricks_sql_access = true
  active                = true
}

/* New configuration */
resource "databricks_service_principal" "common-sp" {
  provider              = databricks
  display_name          = "Common SP ${var.env}"
  databricks_sql_access = true
  active                = true
}

Expected Behavior

The Display Name of the Service Principal should have updated, without creating or destroying the service principal when running terraform apply on the new change.

Actual Behavior

The terraform apply ran successfully and showed the correct display_name change happening in the terraform plan step, and it also wrote that modifications completed successfully.

On the UI, at both the workspace- and account-level, the name of the Service Principal has not updated.

Steps to Reproduce

  1. Create databricks_service_principal resource via terraform apply
  2. Alter definition of databricks_service_principal to change the display_name
  3. Rerun terraform apply to apply your new changes to the display_name

Terraform and provider versions

Terraform -> 1.9.0 Databricks -> 1.50.0

Is it a regression?

Debug Output

Important Factoids

Would you like to implement a fix?

alexott commented 2 months ago

Did you check the UI after few minutes? Did you try to reload a page - some UI elements cache data.

alexott commented 2 months ago

Also, please collect debug logs