databricks / terraform-provider-databricks

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

[ISSUE] Issue with `databricks_grants` resource `Error: cannot create grant: permissions ` when called in parallel #4162

Open LittleWat opened 3 weeks ago

LittleWat commented 3 weeks ago

Configuration

!!! NOTE Using databricks_grants not databricks_grant

resource "databricks_grants" "external_location" {
  provider          = databricks.workspace
  external_location = databricks_external_location.catalog_location.id
  grant {
    principal  = var.admin_group_display_name
    privileges = ["ALL_PRIVILEGES"]
  }
  grant {
    principal  = var.regular_group_display_name
    privileges = ["READ_FILES"]
  }
}

Expected Behavior

can create the grants successfully

Actual Behavior

│ Error: cannot create grants: permissions for external_location-sandbox-dev-location are &{[]}, but have to be {[{sandbox_workspace_users [READ_FILES] []} {sandbox_workspace_admins [ALL_PRIVILEGES] []}]}
│
│   with databricks_grants.external_location,
│   on main.tf line 139, in resource "databricks_grants" "external_location":
│  139: resource "databricks_grants" "external_location" {
│

Steps to Reproduce

simply applying the tf above with calling it in parallel using Terragrunt

(these errors look like to be solved by rerunning terragrunt apply multiple times.

Terraform and provider versions

Is it a regression?

Debug Output

Important Factoids

Would you like to implement a fix?