databricks / terraform-provider-databricks

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

[FEATURE] New data block `databricks_users` #3468

Open w0ut0 opened 5 months ago

w0ut0 commented 5 months ago

Use-cases

I want to be able to get all users provisioned to my Databricks account (or, depending on provider configuration, workspace). My use case is adding them to a certain 'default' catalog (or group), and create a schema for every user that they can use as 'personal space'.

Attempted Solutions

Proposal

A data block that uses the account-level List users endpoint. Should be have similar as existing databricks_service_principals.

data "databricks_users" "users" {
  display_name_contains = "@domain.org"
}

I see it returning 2 possible outputs:

References

Serpinex3 commented 2 months ago

In addition to @w0ut0 request, we would also be happy having a databricks_groups data source similar to databricks_service_principals with an optional attribute display_name_contains.

Something like this:

data "databricks_groups" "groups" {
  display_name_contains = "xyz"
}

This data source would allow us to retrieve a list of all SCIM provisioned Entra ID groups and pass the information (e.g. the Databricks internal group ID) via a configuration store to all our downstream users.