Skip to content

[ISSUE] Issue with databricks_group resource. When adding an external group (i.e. Entra group) to the workspace level it does not create the group at the account level #5174

@haveyoumetcp

Description

@haveyoumetcp

Configuration

provider "databricks" {
  alias = "workspace"
  host = azurerm_databricks_workspace.databricks_workspace.workspace_url
}

data "azuread_group" "test_cdp_user_group" {
  for_each       = toset(var.test_databricks_workspace_user_groups)
  display_name   = each.key
  security_enabled = true
}

resource "databricks_group" "test_cdp_workspace_user_databricks_groups" {
  for_each     = data.azuread_group.test_cdp_user_group
  display_name = each.value.display_name
  external_id  = each.value.object_id
  provider     = databricks.workspace
  force        = true
}

Expected Behavior

The external group is added to the account level.

When adding a group via the UI in the workspace it automatically adds it the account.

Actual Behavior

The external group is not added to the account level.

Steps to Reproduce

  1. `terraform apply

Terraform and provider versions

v1.96.0

Is it a regression?

Not sure it ever worked, but mostly an issue now with the Automated Identity Federation and not importing groups via SCIM.

Debug Output

Important Factoids

I can add the group when using the account level connection with this provider:

provider "databricks" {
  alias      = "account"
  host       = "https://accounts.azuredatabricks.net"
  account_id = var.databricks_account_id
}

However, there's a huge issue with this. If a group is deleted (i.e. in a development process), then the group is deleted at the account level and will impact production processes.

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions