subcategory |
---|
Security |
-> Note If you have a fully automated setup with workspaces created by databricks_mws_workspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.
Retrieves application_ids
of all databricks_service_principal based on their display_name
Adding all service principals of which display name contains my-spn
to admin group
data "databricks_group" "admins" {
display_name = "admins"
}
data "databricks_service_principals" "spns" {
display_name_contains = "my-spn"
}
data "databricks_service_principal" "spn" {
for_each = toset(data.databricks_service_principals.spns.application_ids)
application_id = each.value
}
resource "databricks_group_member" "my_member_spn" {
for_each = toset(data.databricks_service_principals.spns.application_ids)
group_id = data.databricks_group.admins.id
member_id = data.databricks_service_principal.spn[each.value].sp_id
}
Data source allows you to pick service principals by the following attributes
display_name_contains
- (Optional) Only return databricks_service_principal display name that match the given name string
Data source exposes the following attributes:
application_ids
- List ofapplication_ids
of service principals Individual service principal can be retrieved using databricks_service_principal data source
The following resources are used in the same context:
- End to end workspace management guide.
- databricks_current_user data to retrieve information about databricks_user or databricks_service_principal, that is calling Databricks REST API.
- databricks_group to manage groups in Databricks Workspace or Account Console (for AWS deployments).
- databricks_group data to retrieve information about databricks_group members, entitlements and instance profiles.
- databricks_group_instance_profile to attach databricks_instance_profile (AWS) to databricks_group.
- databricks_group_member to attach users and groups as group members.
- databricks_permissions to manage access control in Databricks workspace.
- databricks_service principal to manage service principals