Skip to content
v2.278.0

ArchiveProps Struct ​

The event archive properties.

Example ​

ts
import * as kms from 'aws-cdk-lib/aws-kms';
import { Archive, EventBus } from 'aws-cdk-lib/aws-events';

const stack = new Stack();

declare const kmsKey: kms.IKey;

const eventBus = new EventBus(stack, 'Bus');

const archive = new Archive(stack, 'Archive', {
  kmsKey: kmsKey,
  sourceEventBus: eventBus,
  eventPattern: {
    source: ['aws.ec2']
  },
});
python
import aws_cdk.aws_kms as kms
from aws_cdk.aws_events import Archive, EventBus

# kms_key: kms.IKey


stack = Stack()

event_bus = EventBus(stack, "Bus")

archive = Archive(stack, "Archive",
    kms_key=kms_key,
    source_event_bus=event_bus,
    event_pattern=events.EventPattern(
        source=["aws.ec2"]
    )
)
java
import software.amazon.awscdk.services.kms.*;
import software.amazon.awscdk.services.events.Archive;
import software.amazon.awscdk.services.events.EventBus;

IKey kmsKey;


Stack stack = new Stack();

EventBus eventBus = new EventBus(stack, "Bus");

Archive archive = Archive.Builder.create(stack, "Archive")
        .kmsKey(kmsKey)
        .sourceEventBus(eventBus)
        .eventPattern(EventPattern.builder()
                .source(List.of("aws.ec2"))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.Events;

IKey kmsKey;


var stack = new Stack();

var eventBus = new EventBus(stack, "Bus");

var archive = new Archive(stack, "Archive", new ArchiveProps {
    KmsKey = kmsKey,
    SourceEventBus = eventBus,
    EventPattern = new EventPattern {
        Source = new [] { "aws.ec2" }
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import kms "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var kmsKey IKey


stack := awscdk.Newstack()

eventBus := awscdk.NewEventBus(stack, jsii.String("Bus"))

archive := awscdk.NewArchive(stack, jsii.String("Archive"), &ArchiveProps{
	KmsKey: kmsKey,
	SourceEventBus: eventBus,
	EventPattern: &EventPattern{
		Source: []*string{
			jsii.String("aws.ec2"),
		},
	},
})

Properties ​

archiveNameoptionalstringarchive_nameoptionalstrarchiveNameoptionalStringArchiveNameoptionalstringArchiveNameoptional*string #
The name of the archive.

Default: Automatically generated

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string = none #
A description for the archive.
eventPatternEventPatternevent_patternEventPatterneventPatternEventPatternEventPatternEventPatternEventPatternEventPattern required #
An event pattern to use to filter events sent to the archive.
kmsKeyoptionalIKeykms_keyoptionalIKeykmsKeyoptionalIKeyKmsKeyoptionalIKeyKmsKeyoptionalIKey #
The customer managed key that encrypts this archive.

Default: Use an AWS managed key

retentionoptionalDurationretentionoptionalDurationretentionoptionalDurationRetentionoptionalDurationRetentionoptionalDuration = Infinite #
The number of days to retain events for.

Default value is 0. If set to 0, events are retained indefinitely.

sourceEventBusIEventBusRefsource_event_busIEventBusRefsourceEventBusIEventBusRefSourceEventBusIEventBusRefSourceEventBusIEventBusRef required #
The event source associated with the archive.