archives
Creates, updates, deletes, gets or lists an archives resource.
Overview
| Name | archives |
| Type | Resource |
| Id | aws.mailmanager.archives |
Fields
The following fields are returned by SELECT queries:
- get_archive
- list_archives
| Name | Datatype | Description |
|---|---|---|
archive_arn | string | The Amazon Resource Name (ARN) of the archive. |
archive_id | string | The unique identifier of the archive. |
archive_name | string | The unique name assigned to the archive. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]</code>) |
archive_state | string | The current state of the archive: ACTIVE – The archive is ready and available for use. PENDING_DELETION – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state. (ACTIVE, PENDING_DELETION) |
created_timestamp | string (date-time) | The timestamp of when the archive was created. |
kms_key_arn | string | The Amazon Resource Name (ARN) of the KMS key used to encrypt the archive. (pattern: <code>arn:aws(|-cn|-us-gov|-eusc):kms:[a-z0-9-]{1,20}:[0-9]{12}:(key|alias)/.+</code>) |
last_updated_timestamp | string (date-time) | The timestamp of when the archive was modified. |
retention | object | The retention period for emails in this archive. |
| Name | Datatype | Description |
|---|---|---|
archive_id | string | The unique identifier of the archive. |
archive_name | string | The unique name assigned to the archive. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]</code>) |
archive_state | string | The current state of the archive: ACTIVE – The archive is ready and available for use. PENDING_DELETION – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state. (ACTIVE, PENDING_DELETION) |
last_updated_timestamp | string (date-time) | The timestamp of when the archive was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_archive | select | region | Retrieves the full details and current state of a specified email archive. | |
list_archives | select | region | Returns a list of all email archives in your account. | |
create_archive | insert | region, ArchiveName | Creates a new email archive resource for storing and retaining emails. | |
update_archive | update | region, ArchiveId | Updates the attributes of an existing email archive. | |
delete_archive | delete | region | Initiates deletion of an email archive. This changes the archive state to pending deletion. In this state, no new emails can be added, and existing archived emails become inaccessible (search, export, download). The archive and all of its contents will be permanently deleted 30 days after entering the pending deletion state, regardless of the configured retention period. | |
start_archive_export | exec | region, ArchiveId, FromTimestamp, ToTimestamp, ExportDestinationConfiguration | Initiates an export of emails from the specified archive. | |
start_archive_search | exec | region, ArchiveId, FromTimestamp, ToTimestamp, MaxResults | Initiates a search across emails in the specified archive. | |
stop_archive_export | exec | region, ExportId | Stops an in-progress export of emails from an archive. | |
stop_archive_search | exec | region, SearchId | Stops an in-progress archive search job. |
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_archive
- list_archives
Retrieves the full details and current state of a specified email archive.
SELECT
archive_arn,
archive_id,
archive_name,
archive_state,
created_timestamp,
kms_key_arn,
last_updated_timestamp,
retention
FROM aws.mailmanager.archives
WHERE region = '{{ region }}' -- required
;
Returns a list of all email archives in your account.
SELECT
archive_id,
archive_name,
archive_state,
last_updated_timestamp
FROM aws.mailmanager.archives
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_archive
- Manifest
Creates a new email archive resource for storing and retaining emails.
INSERT INTO aws.mailmanager.archives (
ClientToken,
ArchiveName,
Retention,
KmsKeyArn,
Tags,
region
)
SELECT
'{{ ClientToken }}',
'{{ ArchiveName }}' /* required */,
'{{ Retention }}',
'{{ KmsKeyArn }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
archive_id
;
# Description fields are for documentation purposes
- name: archives
props:
- name: region
value: "{{ region }}"
description: Required parameter for the archives resource.
- name: ClientToken
value: "{{ ClientToken }}"
description: |
A unique token Amazon SES uses to recognize retries of this request.
- name: ArchiveName
value: "{{ ArchiveName }}"
description: |
A unique name for the new archive.
- name: Retention
description: |
The period for retaining emails in the archive before automatic deletion.
value:
RetentionPeriod: "{{ RetentionPeriod }}"
- name: KmsKeyArn
value: "{{ KmsKeyArn }}"
description: |
The Amazon Resource Name (ARN) of the KMS key for encrypting emails in the archive.
- name: Tags
description: |
The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_archive
Updates the attributes of an existing email archive.
UPDATE aws.mailmanager.archives
SET
ArchiveId = '{{ ArchiveId }}',
ArchiveName = '{{ ArchiveName }}',
Retention = '{{ Retention }}'
WHERE
region = '{{ region }}' --required
AND ArchiveId = '{{ ArchiveId }}' --required;
DELETE examples
- delete_archive
Initiates deletion of an email archive. This changes the archive state to pending deletion. In this state, no new emails can be added, and existing archived emails become inaccessible (search, export, download). The archive and all of its contents will be permanently deleted 30 days after entering the pending deletion state, regardless of the configured retention period.
DELETE FROM aws.mailmanager.archives
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- start_archive_export
- start_archive_search
- stop_archive_export
- stop_archive_search
Initiates an export of emails from the specified archive.
EXEC aws.mailmanager.archives.start_archive_export
@region='{{ region }}' --required
@@json=
'{
"ArchiveId": "{{ ArchiveId }}",
"Filters": "{{ Filters }}",
"FromTimestamp": "{{ FromTimestamp }}",
"ToTimestamp": "{{ ToTimestamp }}",
"MaxResults": {{ MaxResults }},
"ExportDestinationConfiguration": "{{ ExportDestinationConfiguration }}",
"IncludeMetadata": {{ IncludeMetadata }}
}'
;
Initiates a search across emails in the specified archive.
EXEC aws.mailmanager.archives.start_archive_search
@region='{{ region }}' --required
@@json=
'{
"ArchiveId": "{{ ArchiveId }}",
"Filters": "{{ Filters }}",
"FromTimestamp": "{{ FromTimestamp }}",
"ToTimestamp": "{{ ToTimestamp }}",
"MaxResults": {{ MaxResults }}
}'
;
Stops an in-progress export of emails from an archive.
EXEC aws.mailmanager.archives.stop_archive_export
@region='{{ region }}' --required
@@json=
'{
"ExportId": "{{ ExportId }}"
}'
;
Stops an in-progress archive search job.
EXEC aws.mailmanager.archives.stop_archive_search
@region='{{ region }}' --required
@@json=
'{
"SearchId": "{{ SearchId }}"
}'
;