AWS::Events::Archive - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


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.


Archives and schema discovery are not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:

  • You call CreateArchive on an event bus set to use a customer managed key for encryption.

  • You call CreateDiscoverer on an event bus set to use a customer managed key for encryption.

  • You call UpdatedEventBus to set a customer managed key on an event bus with an archives or schema discovery enabled.

To enable archives or schema discovery on an event bus, choose to use an Amazon owned key. For more information, see Data encryption in EventBridge in the Amazon EventBridge User Guide.


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


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


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



The name for the archive to create.

Required: No

Type: String

Minimum: 1

Maximum: 48

Update requires: Replacement


A description for the archive.

Required: No

Type: String

Pattern: .*

Maximum: 512

Update requires: No interruption


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

Required: No

Type: Json

Maximum: 4096

Update requires: No interruption


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

Required: No

Type: Integer

Minimum: 0

Update requires: No interruption


The ARN of the event bus that sends events to the archive.

Required: Yes

Type: String

Minimum: 1

Maximum: 1600

Update requires: Replacement

Return values


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


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.


The ARN of the archive created.


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.


{ "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" } }


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'