Skip to main content

direct_group_members

Creates, updates, deletes, gets or lists a direct_group_members resource.

Overview

Namedirect_group_members
TypeResource
Iddatabricks_account.iamv2.direct_group_members

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
external_idstringThe external ID of the principal in Databricks.
principal_idintegerInternal ID of the principal in Databricks.
display_namestringDisplay name of the principal.
membership_sourcestringThe source of group membership (internal or from identity provider). (IDENTITY_PROVIDER, INTERNAL)
principal_typestringThe type of the principal (user/service principal/group). (GROUP, SERVICE_PRINCIPAL, USER)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, group_id, principal_idGets a provisioned direct member of a group.
listselectaccount_id, group_idpage_size, page_tokenLists provisioned direct members of a group with their membership source (internal or from identity
createinsertaccount_id, group_id, direct_group_memberCreates a group membership (assigns a principal to a group).
deletedeleteaccount_id, group_id, principal_idDeletes a group membership (unassigns a principal from a group).

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.

NameDatatypeDescription
account_idstring
group_idintegerRequired. Internal ID of the group in Databricks.
principal_idintegerRequired. Internal ID of the principal to be unassigned from the group.
page_sizeintegerThe maximum number of members to return. The service may return fewer than this value. If not provided, defaults to 1000 (also the maximum allowed).
page_tokenstringA page token, received from a previous ListDirectGroupMembers call. Provide this to retrieve the subsequent page.

SELECT examples

Gets a provisioned direct member of a group.

SELECT
external_id,
principal_id,
display_name,
membership_source,
principal_type
FROM databricks_account.iamv2.direct_group_members
WHERE account_id = '{{ account_id }}' -- required
AND group_id = '{{ group_id }}' -- required
AND principal_id = '{{ principal_id }}' -- required
;

INSERT examples

Creates a group membership (assigns a principal to a group).

INSERT INTO databricks_account.iamv2.direct_group_members (
direct_group_member,
account_id,
group_id
)
SELECT
'{{ direct_group_member }}' /* required */,
'{{ account_id }}',
'{{ group_id }}'
RETURNING
external_id,
principal_id,
display_name,
membership_source,
principal_type
;

DELETE examples

Deletes a group membership (unassigns a principal from a group).

DELETE FROM databricks_account.iamv2.direct_group_members
WHERE account_id = '{{ account_id }}' --required
AND group_id = '{{ group_id }}' --required
AND principal_id = '{{ principal_id }}' --required
;