Skip to main content

archives

Creates, updates, deletes or gets an archive resource or lists archives in a region

Overview

Namearchives
TypeResource
DescriptionResource Type definition for AWS::Events::Archive
Idawscc.events.archives

Fields

NameDatatypeDescription
archive_namestring
source_arnstring
descriptionstring
event_patternobject
arnstring
retention_daysinteger
kms_key_identifierstring
regionstringAWS region.

For more information, see AWS::Events::Archive.

Methods

NameResourceAccessible byRequired Params
create_resourcearchivesINSERTSourceArn, region
delete_resourcearchivesDELETEIdentifier, region
update_resourcearchivesUPDATEIdentifier, PatchDocument, region
list_resourcesarchives_list_onlySELECTregion
get_resourcearchivesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual archive.

SELECT
region,
archive_name,
source_arn,
description,
event_pattern,
arn,
retention_days,
kms_key_identifier
FROM awscc.events.archives
WHERE
region = '{{ region }}' AND
Identifier = '{{ archive_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new archive resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.events.archives (
SourceArn,
region
)
SELECT
'{{ source_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a archive resource, using stack-deploy.

/*+ update */
UPDATE awscc.events.archives
SET PatchDocument = string('{{ {
"Description": description,
"EventPattern": event_pattern,
"RetentionDays": retention_days,
"KmsKeyIdentifier": kms_key_identifier
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ archive_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.events.archives
WHERE
Identifier = '{{ archive_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the archives resource, the following permissions are required:

events:DescribeArchive,
events:CreateArchive,
kms:DescribeKey,
kms:GenerateDataKey,
kms:Decrypt