databricks / terraform-provider-databricks

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

[FEATURE] Create a databricks_group_members resource that can resolve configuration drift #3793

Open DSollick opened 4 months ago

DSollick commented 4 months ago

Use-cases

databricks_group_member objects do not detect configuration drift such as additional users being added to the group outside of IAC which would be very useful to have in the style of databricks_grants.

Proposal

Create a databricks_group_members resource that takes a group id, and n amount of member blocks.

resource "databricks_group_members" "self" {
  group_id  = data.databricks_group.x.id
  member {
    id = data.databricks_user.user1.id
  }
  member {
    id = data.databricks_user.user2.id
  }
}

Or perhaps more realistically

resource "databricks_group_members" "self" {
  for_each = local.databricks_groups
  group_id = each.key
  dynamic "member" {
    for_each = each.value
    content {
      id = member.id
    }
  }
}

group_id is a required field. It should be possible to have 0 member blocks in order to remove all members from the specified group.

mgyucht commented 2 months ago

To clarify, this feature request is about having an authoritative resource for group membership?

DSollick commented 2 months ago

Correct!