archives
Creates, updates, deletes or gets an archive resource or lists archives in a region
Overview
| Name | archives |
| Type | Resource |
| Description | Resource Type definition for AWS::Events::Archive |
| Id | awscc.events.archives |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
archive_name | string | |
source_arn | string | |
description | string | |
event_pattern | object | |
arn | string | |
retention_days | integer | |
kms_key_identifier | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
archive_name | string | |
region | string | AWS region. |
For more information, see AWS::Events::Archive.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | archives | INSERT | SourceArn, region |
delete_resource | archives | DELETE | Identifier, region |
update_resource | archives | UPDATE | Identifier, PatchDocument, region |
list_resources | archives_list_only | SELECT | region |
get_resource | archives | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all archives in a region.
SELECT
region,
archive_name
FROM awscc.events.archives_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new archive resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.events.archives (
SourceArn,
region
)
SELECT
'{{ source_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.events.archives (
ArchiveName,
SourceArn,
Description,
EventPattern,
RetentionDays,
KmsKeyIdentifier,
region
)
SELECT
'{{ archive_name }}',
'{{ source_arn }}',
'{{ description }}',
'{{ event_pattern }}',
'{{ retention_days }}',
'{{ kms_key_identifier }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: archive
props:
- name: archive_name
value: '{{ archive_name }}'
- name: source_arn
value: '{{ source_arn }}'
- name: description
value: '{{ description }}'
- name: event_pattern
value: {}
- name: retention_days
value: '{{ retention_days }}'
- name: kms_key_identifier
value: '{{ kms_key_identifier }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Delete
- List
- Update
- Read
events:DescribeArchive,
events:CreateArchive,
kms:DescribeKey,
kms:GenerateDataKey,
kms:Decrypt
events:DescribeArchive,
events:DeleteArchive
events:ListArchives
events:DescribeArchive,
events:UpdateArchive,
kms:DescribeKey,
kms:GenerateDataKey,
kms:Decrypt,
kms:ReEncryptTo,
kms:ReEncryptFrom
events:DescribeArchive,
kms:Decrypt