Skip to main content

users

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

Overview

Nameusers
TypeResource
Idaws.workmail.users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
citystringCity where the user is located.
companystringCompany of the user.
countrystringCountry where the user is located.
departmentstringDepartment of the user.
disabled_datestring (date-time)The date and time at which the user was disabled for WorkMail usage, in UNIX epoch time format.
display_namestringThe display name of the user.
emailstringThe email of the user. (pattern: <code>[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+.[a-zA-Z-]{2,}</code>)
enabled_datestring (date-time)The date and time at which the user was enabled for WorkMailusage, in UNIX epoch time format.
first_namestringFirst name of the user.
hidden_from_global_address_listbooleanIf enabled, the user is hidden from the global address list.
identity_provider_identity_store_idstringIdentity Store ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail. (pattern: <code>^d-[0-9a-f]{10}$|^[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}$</code>)
identity_provider_user_idstringUser ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail. (pattern: <code>^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$</code>)
initialsstringInitials of the user.
job_titlestringJob title of the user.
last_namestringLast name of the user.
mailbox_deprovisioned_datestring (date-time)The date when the mailbox was removed for the user.
mailbox_provisioned_datestring (date-time)The date when the mailbox was created for the user.
namestringThe name for the user. (pattern: <code>[\w-.]+(@[a-zA-Z0-9.-]+.[a-zA-Z0-9-]{2,})?</code>)
officestringOffice where the user is located.
statestringThe state of a user: enabled (registered to WorkMail) or disabled (deregistered or never registered to WorkMail). (ENABLED, DISABLED, DELETED)
streetstringStreet where the user is located.
telephonestringUser's contact number.
user_idstringThe identifier for the described user.
user_rolestringIn certain cases, other entities are modeled as users. If interoperability is enabled, resources are imported into WorkMail as users. Because different WorkMail organizations rely on different directory types, administrators can distinguish between an unregistered user (account is disabled and has a user role) and the directory administrators. The values are USER, RESOURCE, SYSTEM_USER, and REMOTE_USER. (USER, RESOURCE, SYSTEM_USER, REMOTE_USER)
zip_codestringZip code of the user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_userselectregionProvides information regarding the user.
list_usersselectregionReturns summaries of the organization's users.
create_userinsertregion, OrganizationId, DisplayNameCreates a user who can be used in WorkMail by calling the RegisterToWorkMail operation.
update_userupdateregion, OrganizationId, UserIdUpdates data for the user. To have the latest information, it must be preceded by a DescribeUser call. The dataset in the request should be the one expected when performing another DescribeUser call.
delete_userdeleteregionDeletes a user from WorkMail and all subsequent systems. Before you can delete a user, the user state must be DISABLED. Use the DescribeUser action to confirm the user state. Deleting a user is permanent and cannot be undone. WorkMail archives user mailboxes for 30 days before they are permanently removed.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Provides information regarding the user.

SELECT
city,
company,
country,
department,
disabled_date,
display_name,
email,
enabled_date,
first_name,
hidden_from_global_address_list,
identity_provider_identity_store_id,
identity_provider_user_id,
initials,
job_title,
last_name,
mailbox_deprovisioned_date,
mailbox_provisioned_date,
name,
office,
state,
street,
telephone,
user_id,
user_role,
zip_code
FROM aws.workmail.users
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a user who can be used in WorkMail by calling the RegisterToWorkMail operation.

INSERT INTO aws.workmail.users (
OrganizationId,
Name,
DisplayName,
Password,
Role,
FirstName,
LastName,
HiddenFromGlobalAddressList,
IdentityProviderUserId,
region
)
SELECT
'{{ OrganizationId }}' /* required */,
'{{ Name }}',
'{{ DisplayName }}' /* required */,
'{{ Password }}',
'{{ Role }}',
'{{ FirstName }}',
'{{ LastName }}',
{{ HiddenFromGlobalAddressList }},
'{{ IdentityProviderUserId }}',
'{{ region }}'
RETURNING
user_id
;

UPDATE examples

Updates data for the user. To have the latest information, it must be preceded by a DescribeUser call. The dataset in the request should be the one expected when performing another DescribeUser call.

UPDATE aws.workmail.users
SET
OrganizationId = '{{ OrganizationId }}',
UserId = '{{ UserId }}',
Role = '{{ Role }}',
DisplayName = '{{ DisplayName }}',
FirstName = '{{ FirstName }}',
LastName = '{{ LastName }}',
HiddenFromGlobalAddressList = {{ HiddenFromGlobalAddressList }},
Initials = '{{ Initials }}',
Telephone = '{{ Telephone }}',
Street = '{{ Street }}',
JobTitle = '{{ JobTitle }}',
City = '{{ City }}',
Company = '{{ Company }}',
ZipCode = '{{ ZipCode }}',
Department = '{{ Department }}',
Country = '{{ Country }}',
Office = '{{ Office }}',
IdentityProviderUserId = '{{ IdentityProviderUserId }}'
WHERE
region = '{{ region }}' --required
AND OrganizationId = '{{ OrganizationId }}' --required
AND UserId = '{{ UserId }}' --required;

DELETE examples

Deletes a user from WorkMail and all subsequent systems. Before you can delete a user, the user state must be DISABLED. Use the DescribeUser action to confirm the user state. Deleting a user is permanent and cannot be undone. WorkMail archives user mailboxes for 30 days before they are permanently removed.

DELETE FROM aws.workmail.users
WHERE region = '{{ region }}' --required
;