AWS::Events::Archive - AWS CloudFormation

AWS::Events::Archive

The AWS::Events::Archive resource create an EventBridge archive to send events to. 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.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Events::Archive", "Properties" : { "ArchiveName" : String, "Description" : String, "EventPattern" : Json, "RetentionDays" : Integer, "SourceArn" : String } }

YAML

Type: AWS::Events::Archive Properties: ArchiveName: String Description: String EventPattern: Json RetentionDays: Integer SourceArn: String

Properties

ArchiveName

The name of the archive.

Required: No

Type: String

Update requires: Replacement

Description

A description for the archive.

Required: No

Type: String

Update requires: No interruption

EventPattern

An event pattern to use to filter events sent to the archive.

Required: No

Type: Json

Update requires: No interruption

RetentionDays

The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely.

Required: No

Type: Integer

Update requires: No interruption

SourceArn

The ARN of the event source associated with the archive.

Required: Yes

Type: String

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the archive name.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

ArchiveName

The archive name.

Arn

The ARN of the archive created.

Examples

Create an archive

The following example creates an archive for all EC2 events sent from the default event bus that retains events in the archive for 10 days.

JSON

{ "SampleArchive": "Type" : "AWS::Events::Archive", "Properties" : { "ArchiveName" : "MyArchive", "Description" : "Archive for all EC2 events", "EventPattern" : { "source": [ "aws.ec2" ] }, "RetentionDays" : "10", "SourceArn" : "arn:aws:events:us-west-2:123456789012:event-bus/default" } }

YAML

SampleArchive: Type: 'AWS::Events::Archive' Properties: ArchiveName: MyArchive Description: Archive for all EC2 events EventPattern: source: - "aws.ec2" RetentionDays: 10 SourceArn: 'arn:aws:events:us-west-2:123456789012:event-bus/default'