Skip to main content

organizations

Creates, updates, deletes, gets or lists an organizations resource.

Overview

Nameorganizations
TypeResource
Idaws.workmail.organizations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the organization. (pattern: <code>arn:aws:workmail:[a-z0-9-]*:[a-z0-9-]+:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}</code>)
aliasstringThe alias for an organization. (pattern: <code>^(?!d-)([\da-zA-Z]+)([-][\da-zA-Z]+)*</code>)
completed_datestring (date-time)The date at which the organization became usable in the WorkMail context, in UNIX epoch time format.
default_mail_domainstringThe default mail domain associated with the organization.
directory_idstringThe identifier for the directory associated with an WorkMail organization.
directory_typestringThe type of directory associated with the WorkMail organization.
error_messagestring(Optional) The error message indicating if unexpected behavior was encountered with regards to the organization.
interoperability_enabledbooleanIndicates if interoperability is enabled for this organization.
migration_adminstringThe user ID of the migration admin if migration is enabled for the organization.
organization_idstringThe identifier of an organization. (pattern: <code>^m-[0-9a-f]{32}$</code>)
statestringThe state of an organization.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_organizationselectregionProvides more information regarding a given organization based on its identifier.
list_organizationsselectregionReturns summaries of the customer's organizations.
register_to_work_mailinsertregion, OrganizationId, EntityId, EmailRegisters an existing and disabled user, group, or resource for WorkMail use by associating a mailbox and calendaring capabilities. It performs no change if the user, group, or resource is enabled and fails if the user, group, or resource is deleted. This operation results in the accumulation of costs. For more information, see Pricing. The equivalent console functionality for this operation is Enable. Users can either be created by calling the CreateUser API operation or they can be synchronized from your directory. For more information, see DeregisterFromWorkMail.
create_aliasinsertregion, OrganizationId, EntityIdAdds an alias to the set of a given member (user or group) of WorkMail.
create_organizationinsertregionCreates a new WorkMail organization. Optionally, you can choose to associate an existing AWS Directory Service directory with your organization. If an AWS Directory Service directory ID is specified, the organization alias must match the directory alias. If you choose not to associate an existing directory with your organization, then we create a new WorkMail directory for you. For more information, see Adding an organization in the WorkMail Administrator Guide. You can associate multiple email domains with an organization, then choose your default email domain from the WorkMail console. You can also associate a domain that is managed in an Amazon Route 53 public hosted zone. For more information, see Adding a domain and Choosing the default domain in the WorkMail Administrator Guide. Optionally, you can use a customer managed key from AWS Key Management Service (AWS KMS) to encrypt email for your organization. If you don't associate an AWS KMS key, WorkMail creates a default, AWS managed key for you.
update_mailbox_quotaupdateregion, OrganizationId, UserId, MailboxQuotaUpdates a user's current mailbox quota for a specified organization and user.
update_primary_email_addressupdateregion, OrganizationId, EntityId, EmailUpdates the primary email for a user, group, or resource. The current email is moved into the list of aliases (or swapped between an existing alias and the current primary email), and the email provided in the input is promoted as the primary.
put_retention_policyreplaceregion, OrganizationId, Name, FolderConfigurationsPuts a retention policy to the specified organization.
delete_aliasdeleteregionRemove one or more specified aliases from a set of aliases for a given user.
delete_organizationdeleteregionDeletes an WorkMail organization and all underlying AWS resources managed by WorkMail as part of the organization. You can choose whether to delete the associated directory. For more information, see Removing an organization in the WorkMail Administrator Guide.
delete_retention_policydeleteregionDeletes the specified retention policy from the specified organization.
cancel_mailbox_export_jobexecregion, ClientToken, JobId, OrganizationIdCancels a mailbox export job. If the mailbox export job is near completion, it might not be possible to cancel it.
deregister_from_work_mailexecregion, OrganizationId, EntityIdMark a user, group, or resource as no longer used in WorkMail. This action disassociates the mailbox and schedules it for clean-up. WorkMail keeps mailboxes for 30 days before they are permanently removed. The functionality in the console is Disable.
reset_passwordexecregion, OrganizationId, UserId, PasswordAllows the administrator to reset the password for a user.
start_mailbox_export_jobexecregion, ClientToken, OrganizationId, EntityId, RoleArn, KmsKeyArn, S3BucketName, S3PrefixStarts a mailbox export job to export MIME-format email messages and calendar items from the specified mailbox to the specified Amazon Simple Storage Service (Amazon S3) bucket. For more information, see Exporting mailbox content in the WorkMail Administrator Guide.
test_availability_configurationexecregion, OrganizationIdPerforms a test on an availability provider to ensure that access is allowed. For EWS, it verifies the provided credentials can be used to successfully log in. For Lambda, it verifies that the Lambda function can be invoked and that the resource access policy was configured to deny anonymous access. An anonymous invocation is one done without providing either a SourceArn or SourceAccount header. The request must contain either one provider definition (EwsProvider or LambdaProvider) or the DomainName parameter. If the DomainName parameter is provided, the configuration stored under the DomainName will be tested.

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 more information regarding a given organization based on its identifier.

SELECT
arn,
alias,
completed_date,
default_mail_domain,
directory_id,
directory_type,
error_message,
interoperability_enabled,
migration_admin,
organization_id,
state
FROM aws.workmail.organizations
WHERE region = '{{ region }}' -- required
;

INSERT examples

Registers an existing and disabled user, group, or resource for WorkMail use by associating a mailbox and calendaring capabilities. It performs no change if the user, group, or resource is enabled and fails if the user, group, or resource is deleted. This operation results in the accumulation of costs. For more information, see Pricing. The equivalent console functionality for this operation is Enable. Users can either be created by calling the CreateUser API operation or they can be synchronized from your directory. For more information, see DeregisterFromWorkMail.

INSERT INTO aws.workmail.organizations (
OrganizationId,
EntityId,
Email,
region
)
SELECT
'{{ OrganizationId }}' /* required */,
'{{ EntityId }}' /* required */,
'{{ Email }}' /* required */,
'{{ region }}'
;

UPDATE examples

Updates a user's current mailbox quota for a specified organization and user.

UPDATE aws.workmail.organizations
SET
OrganizationId = '{{ OrganizationId }}',
UserId = '{{ UserId }}',
MailboxQuota = {{ MailboxQuota }}
WHERE
region = '{{ region }}' --required
AND OrganizationId = '{{ OrganizationId }}' --required
AND UserId = '{{ UserId }}' --required
AND MailboxQuota = '{{ MailboxQuota }}' --required;

REPLACE examples

Puts a retention policy to the specified organization.

REPLACE aws.workmail.organizations
SET
OrganizationId = '{{ OrganizationId }}',
Id = '{{ Id }}',
Name = '{{ Name }}',
Description = '{{ Description }}',
FolderConfigurations = '{{ FolderConfigurations }}'
WHERE
region = '{{ region }}' --required
AND OrganizationId = '{{ OrganizationId }}' --required
AND Name = '{{ Name }}' --required
AND FolderConfigurations = '{{ FolderConfigurations }}' --required;

DELETE examples

Remove one or more specified aliases from a set of aliases for a given user.

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

Lifecycle Methods

Cancels a mailbox export job. If the mailbox export job is near completion, it might not be possible to cancel it.

EXEC aws.workmail.organizations.cancel_mailbox_export_job
@region='{{ region }}' --required
@@json=
'{
"ClientToken": "{{ ClientToken }}",
"JobId": "{{ JobId }}",
"OrganizationId": "{{ OrganizationId }}"
}'
;