Skip to main content

groups

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

Overview

Namegroups
TypeResource
Idaws.ds_data.groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
distinguished_namestringThe distinguished name of the object.
group_scopestringThe scope of the AD group. For details, see Active Directory security groups (DomainLocal, Global, Universal, BuiltinLocal)
group_typestringThe AD group type. For details, see Active Directory security group type. (Distribution, Security)
other_attributesobjectAn expression of one or more attributes, data types, and the values of a group.
sam_account_namestringThe name of the group. (pattern: <code>^[^:;|=+"*?<>/\,&#91;&#93;@]+$</code>)
sidstringThe unique security identifier (SID) of the group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
search_groupsselectDirectoryId, regionSearches the specified directory for a group. You can find groups that match the SearchString parameter with the value of their attributes included in the SearchString parameter. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchGroups.NextToken member contains a token that you pass in the next call to SearchGroups. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter.
describe_groupselectDirectoryId, regionReturns information about a specific group.
list_groupsselectDirectoryId, regionReturns group information for the specified directory. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroups.NextToken member contains a token that you pass in the next call to ListGroups. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter.
create_groupinsertDirectoryId, region, SAMAccountNameCreates a new group.
update_groupupdateDirectoryId, region, SAMAccountNameUpdates group information.
delete_groupdeleteDirectoryId, regionDeletes 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
DirectoryIdstringThe identifier (ID) of the directory that's associated with the group.
regionstringAWS region (default: us-east-1)

SELECT examples

Searches the specified directory for a group. You can find groups that match the SearchString parameter with the value of their attributes included in the SearchString parameter. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchGroups.NextToken member contains a token that you pass in the next call to SearchGroups. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter.

SELECT
distinguished_name,
group_scope,
group_type,
other_attributes,
sam_account_name,
sid
FROM aws.ds_data.groups
WHERE DirectoryId = '{{ DirectoryId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new group.

INSERT INTO aws.ds_data.groups (
ClientToken,
GroupScope,
GroupType,
OtherAttributes,
SAMAccountName,
DirectoryId,
region
)
SELECT
'{{ ClientToken }}',
'{{ GroupScope }}',
'{{ GroupType }}',
'{{ OtherAttributes }}',
'{{ SAMAccountName }}' /* required */,
'{{ DirectoryId }}',
'{{ region }}'
RETURNING
directory_id,
sam_account_name,
sid
;

UPDATE examples

Updates group information.

UPDATE aws.ds_data.groups
SET
ClientToken = '{{ ClientToken }}',
GroupScope = '{{ GroupScope }}',
GroupType = '{{ GroupType }}',
OtherAttributes = '{{ OtherAttributes }}',
SAMAccountName = '{{ SAMAccountName }}',
UpdateType = '{{ UpdateType }}'
WHERE
DirectoryId = '{{ DirectoryId }}' --required
AND region = '{{ region }}' --required
AND SAMAccountName = '{{ SAMAccountName }}' --required;

DELETE examples

Deletes a group.

DELETE FROM aws.ds_data.groups
WHERE DirectoryId = '{{ DirectoryId }}' --required
AND region = '{{ region }}' --required
;