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 the customer's IdP.
group_idintegerThe internal ID of the group this member belongs to.
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_id, account_hostGets a provisioned direct member of a group.
listselectaccount_id, group_id, account_hostpage_size, page_tokenLists provisioned direct members of a group with their membership source (internal or from identity
createinsertaccount_id, group_id, account_host, principal_idCreates a group membership (assigns a principal to a group).
deletedeleteaccount_id, group_id, principal_id, account_hostDeletes 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_hoststringThe Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}})
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, which is also the maximum allowed. Requests for more than the maximum are clamped to 1000.
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,
group_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
AND account_host = '{{ account_host }}' -- required
;

INSERT examples​

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

INSERT INTO databricks_account.iamv2.direct_group_members (
principal_id,
display_name,
external_id,
group_id,
membership_source,
principal_type,
account_id,
group_id,
account_host
)
SELECT
{{ principal_id }} /* required */,
'{{ display_name }}',
'{{ external_id }}',
{{ group_id }},
'{{ membership_source }}',
'{{ principal_type }}',
'{{ account_id }}',
{{ group_id }},
'{{ account_host }}'
RETURNING
external_id,
group_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
AND account_host = '{{ account_host }}' --required
;