Skip to content

Archive

Source: src/AWS/EventBridge/Archive.ts

An Amazon EventBridge archive that retains events from an event bus so they can later be replayed (see the replay bindings: StartReplay, DescribeReplay, CancelReplay, ListReplays).

Archives do not support tags, so ownership is tracked by the deterministic physical name.

Archive All Events on a Bus

const bus = yield* AWS.EventBridge.EventBus("AppEvents", {});
const archive = yield* AWS.EventBridge.Archive("AppArchive", {
eventSourceArn: bus.eventBusArn,
retention: "30 days",
});

Archive a Filtered Subset of Events

const archive = yield* AWS.EventBridge.Archive("OrderArchive", {
eventSourceArn: bus.eventBusArn,
description: "Order events only",
eventPattern: { source: ["my.app"], "detail-type": ["OrderCreated"] },
retention: "90 days",
});