users
Creates, updates, deletes, gets or lists a users resource.
Overview
| Name | users |
| Type | Resource |
| Id | databricks_workspace.iamv2.users |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
account_id | string | The accountId parent of the user in Databricks. |
external_id | string | ExternalId of the user in the customer's IdP. |
internal_id | string | Internal userId of the user in Databricks. |
full_name | object | |
account_user_status | string | The activity status of a user in a Databricks account. (ACTIVE, INACTIVE) |
username | string | Username/email of the user. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | The accountId parent of the user in Databricks. |
external_id | string | ExternalId of the user in the customer's IdP. |
internal_id | string | Internal userId of the user in Databricks. |
full_name | object | |
account_user_status | string | The activity status of a user in a Databricks account. (ACTIVE, INACTIVE) |
username | string | Username/email of the user. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | internal_id, deployment_name | Fetches a user by its internal ID from the Databricks account that parents the calling workspace. | |
list | select | deployment_name | filter, page_size, page_token | Lists the users in the Databricks account that parents the calling workspace, returning one page per |
create | insert | deployment_name, user | Creates a user in the Databricks account that parents the calling workspace and returns the resulting | |
update | update | internal_id, update_mask, deployment_name, user | Updates an existing user in the Databricks account that parents the calling workspace. Only the fields | |
delete | delete | internal_id, deployment_name | Deletes a user by its internal ID from the Databricks account that parents the calling workspace. | |
resolve | exec | deployment_name, external_id | Resolves a user with the given external ID from the customer's IdP. If the user does not exist, it |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
internal_id | string | Required. Internal ID of the user in Databricks. |
update_mask | string | Optional. The list of fields to update. |
filter | string | Optional. Allows filtering users by username or external id. |
page_size | integer | The maximum number of users to return. The service may return fewer than this value. |
page_token | string | A page token, received from a previous ListUsers call. Provide this to retrieve the subsequent page. |
SELECT examples
- get
- list
Fetches a user by its internal ID from the Databricks account that parents the calling workspace.
SELECT
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username
FROM databricks_workspace.iamv2.users
WHERE internal_id = '{{ internal_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
Lists the users in the Databricks account that parents the calling workspace, returning one page per
SELECT
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username
FROM databricks_workspace.iamv2.users
WHERE deployment_name = '{{ deployment_name }}' -- required
AND filter = '{{ filter }}'
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a user in the Databricks account that parents the calling workspace and returns the resulting
INSERT INTO databricks_workspace.iamv2.users (
user,
deployment_name
)
SELECT
'{{ user }}' /* required */,
'{{ deployment_name }}'
RETURNING
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username
;
# Description fields are for documentation purposes
- name: users
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the users resource.
- name: user
description: |
Required. User to be created in <Databricks>
value:
account_id: "{{ account_id }}"
account_user_status: "{{ account_user_status }}"
external_id: "{{ external_id }}"
full_name:
family_name: "{{ family_name }}"
given_name: "{{ given_name }}"
internal_id: "{{ internal_id }}"
username: "{{ username }}"
UPDATE examples
- update
Updates an existing user in the Databricks account that parents the calling workspace. Only the fields
UPDATE databricks_workspace.iamv2.users
SET
user = '{{ user }}'
WHERE
internal_id = '{{ internal_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND user = '{{ user }}' --required
RETURNING
account_id,
external_id,
internal_id,
full_name,
account_user_status,
username;
DELETE examples
- delete
Deletes a user by its internal ID from the Databricks account that parents the calling workspace.
DELETE FROM databricks_workspace.iamv2.users
WHERE internal_id = '{{ internal_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;
Lifecycle Methods
- resolve
Resolves a user with the given external ID from the customer's IdP. If the user does not exist, it
EXEC databricks_workspace.iamv2.users.resolve
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"external_id": "{{ external_id }}"
}'
;