Skip to main content

archives

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

Overview

Namearchives
TypeResource
Idaws.mailmanager.archives

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
archive_arnstringThe Amazon Resource Name (ARN) of the archive.
archive_idstringThe unique identifier of the archive.
archive_namestringThe unique name assigned to the archive. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]</code>)
archive_statestringThe 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_timestampstring (date-time)The timestamp of when the archive was created.
kms_key_arnstringThe 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_timestampstring (date-time)The timestamp of when the archive was modified.
retentionobjectThe retention period for emails in this archive.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_archiveselectregionRetrieves the full details and current state of a specified email archive.
list_archivesselectregionReturns a list of all email archives in your account.
create_archiveinsertregion, ArchiveNameCreates a new email archive resource for storing and retaining emails.
update_archiveupdateregion, ArchiveIdUpdates the attributes of an existing email archive.
delete_archivedeleteregionInitiates 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_exportexecregion, ArchiveId, FromTimestamp, ToTimestamp, ExportDestinationConfigurationInitiates an export of emails from the specified archive.
start_archive_searchexecregion, ArchiveId, FromTimestamp, ToTimestamp, MaxResultsInitiates a search across emails in the specified archive.
stop_archive_exportexecregion, ExportIdStops an in-progress export of emails from an archive.
stop_archive_searchexecregion, SearchIdStops 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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 }}
}'
;