archives
Creates, updates, deletes, gets or lists an archives resource.
Overview
| Name | archives |
| Type | Resource |
| Id | aws.events.archives |
Fields
The following fields are returned by SELECT queries:
- describe_archive
- list_archives
| Name | Datatype | Description |
|---|---|---|
archive_arn | string | The ARN of the archive. (pattern: <code>^arn:aws([a-z]|-):events:([a-z]|\d|-):([0-9]{12})?:.+/.+$</code>) |
archive_name | string | The name of the archive. (pattern: <code>[.-_A-Za-z0-9]+</code>) |
creation_time | string (date-time) | The time at which the archive was created. |
description | string | The description of the archive. (pattern: <code>.*</code>) |
event_count | integer (int64) | The number of events in the archive. |
event_pattern | string | The event pattern used to filter events sent to the archive. |
event_source_arn | string | The 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_identifier | string | The 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_days | integer | The number of days to retain events for in the archive. |
size_bytes | integer (int64) | The size of the archive in bytes. |
state | string | The state of the archive. (ENABLED, DISABLED, CREATING, UPDATING, CREATE_FAILED, UPDATE_FAILED) |
state_reason | string | The reason that the archive is in the state. (pattern: <code>.*</code>) |
| Name | Datatype | Description |
|---|---|---|
archives | array | An array of Archive objects that include details about an archive. |
next_token | string | A token indicating there are more results available. If there are no more results, no token is included in the response. The value of nextToken is a unique pagination token for each page. To retrieve the next page of results, make the call again using the returned token. Keep all other arguments unchanged. Using an expired pagination token results in an HTTP 400 InvalidToken error. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_archive | select | region | Retrieves details about an archive. | |
list_archives | select | region | Lists 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_archive | insert | region, ArchiveName, EventSourceArn | 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. | |
update_archive | update | region, ArchiveName | Updates the specified archive. | |
delete_archive | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_archive
- list_archives
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
;
Lists 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.
SELECT
archives,
next_token
FROM aws.events.archives
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_archive
- Manifest
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
;
# Description fields are for documentation purposes
- name: archives
props:
- name: region
value: "{{ region }}"
description: Required parameter for the archives resource.
- name: ArchiveName
value: "{{ ArchiveName }}"
description: |
The name for the archive to create.
- name: EventSourceArn
value: "{{ EventSourceArn }}"
description: |
The ARN of the event bus that sends events to the archive.
- name: Description
value: "{{ Description }}"
description: |
A description for the archive.
- name: EventPattern
value: "{{ EventPattern }}"
description: |
An event pattern to use to filter events sent to the archive.
- name: RetentionDays
value: {{ RetentionDays }}
description: |
The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely
- name: KmsKeyIdentifier
value: "{{ KmsKeyIdentifier }}"
description: |
The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN. If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive. For more information, see Identify and view keys in the Key Management Service Developer Guide. 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 examples
- update_archive
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
- delete_archive
Deletes the specified archive.
DELETE FROM aws.events.archives
WHERE region = '{{ region }}' --required
;