Skip to main content

archives

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

Overview

Namearchives
TypeResource
Idaws.events.archives

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
archive_arnstringThe ARN of the archive. (pattern: <code>^arn:aws([a-z]|-):events:([a-z]|\d|-):([0-9]{12})?:.+/.+$</code>)
archive_namestringThe name of the archive. (pattern: <code>[.-_A-Za-z0-9]+</code>)
creation_timestring (date-time)The time at which the archive was created.
descriptionstringThe description of the archive. (pattern: <code>.*</code>)
event_countinteger (int64)The number of events in the archive.
event_patternstringThe event pattern used to filter events sent to the archive.
event_source_arnstringThe ARN of the event source associated with the archive. (pattern: <code>^arn:aws([a-z]|-):events:([a-z]|\d|-):([0-9]{12})?:.+/.+$</code>)
kms_key_identifierstringThe identifier of the KMS customer managed key for EventBridge to use to encrypt this archive, if one has been specified. For more information, see Encrypting archives in the Amazon EventBridge User Guide. (pattern: <code>^[a-zA-Z0-9_-/:]*$</code>)
retention_daysintegerThe number of days to retain events for in the archive.
size_bytesinteger (int64)The size of the archive in bytes.
statestringThe state of the archive. (ENABLED, DISABLED, CREATING, UPDATING, CREATE_FAILED, UPDATE_FAILED)
state_reasonstringThe reason that the archive is in the state. (pattern: <code>.*</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_archiveselectregionRetrieves details about an archive.
list_archivesselectregionLists your archives. You can either list all the archives or you can provide a prefix to match to the archive names. Filter parameters are exclusive.
create_archiveinsertregion, ArchiveName, EventSourceArnCreates an archive of events with the specified settings. When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive. If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well. For more information, see Encrypting archives in the Amazon EventBridge User Guide.
update_archiveupdateregion, ArchiveNameUpdates the specified archive.
delete_archivedeleteregionDeletes the specified archive.

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 details about an archive.

SELECT
archive_arn,
archive_name,
creation_time,
description,
event_count,
event_pattern,
event_source_arn,
kms_key_identifier,
retention_days,
size_bytes,
state,
state_reason
FROM aws.events.archives
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an archive of events with the specified settings. When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive. If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well. For more information, see Encrypting archives in the Amazon EventBridge User Guide.

INSERT INTO aws.events.archives (
ArchiveName,
EventSourceArn,
Description,
EventPattern,
RetentionDays,
KmsKeyIdentifier,
region
)
SELECT
'{{ ArchiveName }}' /* required */,
'{{ EventSourceArn }}' /* required */,
'{{ Description }}',
'{{ EventPattern }}',
{{ RetentionDays }},
'{{ KmsKeyIdentifier }}',
'{{ region }}'
RETURNING
archive_arn,
creation_time,
state,
state_reason
;

UPDATE examples

Updates the specified archive.

UPDATE aws.events.archives
SET
ArchiveName = '{{ ArchiveName }}',
Description = '{{ Description }}',
EventPattern = '{{ EventPattern }}',
RetentionDays = {{ RetentionDays }},
KmsKeyIdentifier = '{{ KmsKeyIdentifier }}'
WHERE
region = '{{ region }}' --required
AND ArchiveName = '{{ ArchiveName }}' --required
RETURNING
archive_arn,
creation_time,
state,
state_reason;

DELETE examples

Deletes the specified archive.

DELETE FROM aws.events.archives
WHERE region = '{{ region }}' --required
;