users
Creates, updates, deletes, gets or lists a users resource.
Overview
| Name | users |
| Type | Resource |
| Id | aws.ds_data.users |
Fields
The following fields are returned by SELECT queries:
- search_users
- describe_user
- list_users
| Name | Datatype | Description |
|---|---|---|
distinguished_name | string | The distinguished name of the object. |
email_address | string | The email address of the user. |
enabled | boolean | Indicates whether the user account is active. |
given_name | string | The first name of the user. |
other_attributes | object | An expression that includes one or more attributes, data types, and values of a user. |
sam_account_name | string | The name of the user. (pattern: <code>^[\w-.]+$</code>) |
sid | string | The unique security identifier (SID) of the user. |
surname | string | The last name of the user. |
user_principal_name | string | The UPN that is an internet-style login name for a user and based on the internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember. |
| Name | Datatype | Description |
|---|---|---|
directory_id | string | The identifier (ID) of the directory that's associated with the user. (pattern: <code>^d-[0-9a-f]{10}$</code>) |
distinguished_name | string | The distinguished name of the object. |
email_address | string | The email address of the user. |
enabled | boolean | Indicates whether the user account is active. |
given_name | string | The first name of the user. |
other_attributes | object | The attribute values that are returned for the attribute names that are included in the request. Attribute names are case insensitive. |
realm | string | The domain name that's associated with the user. (pattern: <code>^([a-zA-Z0-9]+[\.-])+([a-zA-Z0-9])+[.]?$</code>) |
sam_account_name | string | The name of the user. (pattern: <code>^[\w-.]+$</code>) |
sid | string | The unique security identifier (SID) of the user. |
surname | string | The last name of the user. |
user_principal_name | string | The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember. |
| Name | Datatype | Description |
|---|---|---|
enabled | boolean | Indicates whether the user account is active. |
given_name | string | The first name of the user. |
sam_account_name | string | The name of the user. (pattern: <code>^[\w-.]+$</code>) |
sid | string | The unique security identifier (SID) of the user. |
surname | string | The last name of the user. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
search_users | select | DirectoryId, region | Searches the specified directory for a user. You can find users 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 SearchUsers.NextToken member contains a token that you pass in the next call to SearchUsers. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter. | |
describe_user | select | DirectoryId, region | Returns information about a specific user. | |
list_users | select | DirectoryId, region | Returns user 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 ListUsers.NextToken member contains a token that you pass in the next call to ListUsers. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter. | |
create_user | insert | DirectoryId, region, SAMAccountName | Creates a new user. | |
update_user | update | DirectoryId, region, SAMAccountName | Updates user information. | |
delete_user | delete | DirectoryId, region | Deletes a user. |
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 |
|---|---|---|
DirectoryId | string | The identifier (ID) of the directory that's associated with the user. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- search_users
- describe_user
- list_users
Searches the specified directory for a user. You can find users 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 SearchUsers.NextToken member contains a token that you pass in the next call to SearchUsers. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter.
SELECT
distinguished_name,
email_address,
enabled,
given_name,
other_attributes,
sam_account_name,
sid,
surname,
user_principal_name
FROM aws.ds_data.users
WHERE DirectoryId = '{{ DirectoryId }}' -- required
AND region = '{{ region }}' -- required
;
Returns information about a specific user.
SELECT
directory_id,
distinguished_name,
email_address,
enabled,
given_name,
other_attributes,
realm,
sam_account_name,
sid,
surname,
user_principal_name
FROM aws.ds_data.users
WHERE DirectoryId = '{{ DirectoryId }}' -- required
AND region = '{{ region }}' -- required
;
Returns user 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 ListUsers.NextToken member contains a token that you pass in the next call to ListUsers. This retrieves the next set of items. You can also specify a maximum number of return results with the MaxResults parameter.
SELECT
enabled,
given_name,
sam_account_name,
sid,
surname
FROM aws.ds_data.users
WHERE DirectoryId = '{{ DirectoryId }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_user
- Manifest
Creates a new user.
INSERT INTO aws.ds_data.users (
ClientToken,
EmailAddress,
GivenName,
OtherAttributes,
SAMAccountName,
Surname,
DirectoryId,
region
)
SELECT
'{{ ClientToken }}',
'{{ EmailAddress }}',
'{{ GivenName }}',
'{{ OtherAttributes }}',
'{{ SAMAccountName }}' /* required */,
'{{ Surname }}',
'{{ DirectoryId }}',
'{{ region }}'
RETURNING
directory_id,
sam_account_name,
sid
;
# Description fields are for documentation purposes
- name: users
props:
- name: DirectoryId
value: "{{ DirectoryId }}"
description: Required parameter for the users resource.
- name: region
value: "{{ region }}"
description: Required parameter for the users resource.
- name: ClientToken
value: "{{ ClientToken }}"
- name: EmailAddress
value: "{{ EmailAddress }}"
- name: GivenName
value: "{{ GivenName }}"
- name: OtherAttributes
value: "{{ OtherAttributes }}"
- name: SAMAccountName
value: "{{ SAMAccountName }}"
- name: Surname
value: "{{ Surname }}"
UPDATE examples
- update_user
Updates user information.
UPDATE aws.ds_data.users
SET
ClientToken = '{{ ClientToken }}',
EmailAddress = '{{ EmailAddress }}',
GivenName = '{{ GivenName }}',
OtherAttributes = '{{ OtherAttributes }}',
SAMAccountName = '{{ SAMAccountName }}',
Surname = '{{ Surname }}',
UpdateType = '{{ UpdateType }}'
WHERE
DirectoryId = '{{ DirectoryId }}' --required
AND region = '{{ region }}' --required
AND SAMAccountName = '{{ SAMAccountName }}' --required;
DELETE examples
- delete_user
Deletes a user.
DELETE FROM aws.ds_data.users
WHERE DirectoryId = '{{ DirectoryId }}' --required
AND region = '{{ region }}' --required
;