mail_domains
Creates, updates, deletes, gets or lists a mail_domains resource.
Overview
| Name | mail_domains |
| Type | Resource |
| Id | aws.workmail.mail_domains |
Fields
The following fields are returned by SELECT queries:
- get_mail_domain
- list_mail_domains
| Name | Datatype | Description |
|---|---|---|
dkim_verification_status | string | Indicates the status of a DKIM verification. (PENDING, VERIFIED, FAILED) |
is_default | boolean | Specifies whether the domain is the default domain for your organization. |
is_test_domain | boolean | Specifies whether the domain is a test domain provided by WorkMail, or a custom domain. |
ownership_verification_status | string | Indicates the status of the domain ownership verification. (PENDING, VERIFIED, FAILED) |
records | array | A list of the DNS records that WorkMail recommends adding in your DNS provider for the best user experience. The records configure your domain with DMARC, SPF, DKIM, and direct incoming email traffic to SES. See admin guide for more details. |
| Name | Datatype | Description |
|---|---|---|
mail_domains | array | The list of mail domain summaries, specifying domains that exist in the specified WorkMail organization, along with the information about whether the domain is or isn't the default. |
next_token | string | The token to use to retrieve the next page of results. The value becomes null when there are no more results to return. (pattern: <code>[\S\s]*|[a-zA-Z0-9/+=]{1,1024}</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_mail_domain | select | region | Gets details for a mail domain, including domain records required to configure your domain with recommended security. | |
list_mail_domains | select | region | Lists the mail domains in a given WorkMail organization. | |
register_mail_domain | insert | region, OrganizationId, DomainName | Registers a new domain in WorkMail and SES, and configures it for use by WorkMail. Emails received by SES for this domain are routed to the specified WorkMail organization, and WorkMail has permanent permission to use the specified domain for sending your users' emails. | |
update_default_mail_domain | update | region, OrganizationId, DomainName | Updates the default mail domain for an organization. The default mail domain is used by the WorkMail AWS Console to suggest an email address when enabling a mail user. You can only have one default domain. | |
deregister_mail_domain | delete | region | Removes a domain from WorkMail, stops email routing to WorkMail, and removes the authorization allowing WorkMail use. SES keeps the domain because other applications may use it. You must first remove any email address used by WorkMail entities before you remove the domain. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_mail_domain
- list_mail_domains
Gets details for a mail domain, including domain records required to configure your domain with recommended security.
SELECT
dkim_verification_status,
is_default,
is_test_domain,
ownership_verification_status,
records
FROM aws.workmail.mail_domains
WHERE region = '{{ region }}' -- required
;
Lists the mail domains in a given WorkMail organization.
SELECT
mail_domains,
next_token
FROM aws.workmail.mail_domains
WHERE region = '{{ region }}' -- required
;
INSERT examples
- register_mail_domain
- Manifest
Registers a new domain in WorkMail and SES, and configures it for use by WorkMail. Emails received by SES for this domain are routed to the specified WorkMail organization, and WorkMail has permanent permission to use the specified domain for sending your users' emails.
INSERT INTO aws.workmail.mail_domains (
ClientToken,
OrganizationId,
DomainName,
region
)
SELECT
'{{ ClientToken }}',
'{{ OrganizationId }}' /* required */,
'{{ DomainName }}' /* required */,
'{{ region }}'
;
# Description fields are for documentation purposes
- name: mail_domains
props:
- name: region
value: "{{ region }}"
description: Required parameter for the mail_domains resource.
- name: ClientToken
value: "{{ ClientToken }}"
description: |
Idempotency token used when retrying requests.
- name: OrganizationId
value: "{{ OrganizationId }}"
description: |
The WorkMail organization under which you're creating the domain.
- name: DomainName
value: "{{ DomainName }}"
description: |
The name of the mail domain to create in WorkMail and SES.
UPDATE examples
- update_default_mail_domain
Updates the default mail domain for an organization. The default mail domain is used by the WorkMail AWS Console to suggest an email address when enabling a mail user. You can only have one default domain.
UPDATE aws.workmail.mail_domains
SET
OrganizationId = '{{ OrganizationId }}',
DomainName = '{{ DomainName }}'
WHERE
region = '{{ region }}' --required
AND OrganizationId = '{{ OrganizationId }}' --required
AND DomainName = '{{ DomainName }}' --required;
DELETE examples
- deregister_mail_domain
Removes a domain from WorkMail, stops email routing to WorkMail, and removes the authorization allowing WorkMail use. SES keeps the domain because other applications may use it. You must first remove any email address used by WorkMail entities before you remove the domain.
DELETE FROM aws.workmail.mail_domains
WHERE region = '{{ region }}' --required
;