Creating event archives in Amazon EventBridge
When you create an archive in EventBridge, you can determine which events are sent to the archive by specifying an event pattern. EventBridge sends events that match the event pattern to the archive. You also set the retention period to store events in the archive before they are discarded.
You can also create archives as part of creating an event bus. These archives have an indefinite retention policy and no event filter, although this can be updated once the archive is created.
Define the archive
First, enter a name and description for archive, and specify the event bus from which it receives events. Optionally, you can also set how long to retain events in the archive.
To define the archive
-
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/
. -
Navigate to the source event bus, or create the archive directly:
-
In the navigation pane, choose Event buses.
On the events bus details page, choose the Archives tab.
In the navigation pane, choose Archives.
-
-
Choose Create archive.
-
Under Archive detail, enter a name and optionally, a description for the archive.
The name must be unique to your account in the selected Region. You can't change the name after you create the archive.
-
For Source, select the event bus you want to send events to the archive
If you navigated from an existing event bus details page, the name of that event bus appears by default.
You cannot change the source event bus once you have created the archive.
-
For Retention period, specify how long to retain the events in the archive:
-
Choose Indefinite to retain the events in the archive and not ever delete them.
-
For a set retention period, enter the number of days after which EventBridge should delete the events from the archive.
-
-
For Encryption, choose the KMS key for EventBridge to use when encrypting the events stored in the archive.
Important
If you have specify that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.
-
Choose Use AWS owned key for EventBridge to encrypt the data using an AWS owned key.
This AWS owned key is a KMS key that EventBridge owns and manages for use in multiple AWS accounts. In general, unless you are required to audit or control the encryption key that protects your resources, an AWS owned key is a good choice.
This is the default.
-
Choose Use customer managed key for EventBridge to encrypt the data using the customer managed key that you specify or create.
Customer managed key are KMS keys in your AWS account that you create, own, and manage. You have full control over these KMS keys.
-
Specify an existing customer managed key, or choose Create a new KMS key />.
EventBridge displays the key status and any key aliases that have been associated with the specified customer managed key.
-
-
-
Choose Next.
Build the event pattern (optional)
Next, as an optional step, you can build an event pattern to filter which events EventBridge sends to the archive. To do this, specify the event source, choose the basis for the event pattern, and define the attributes and values to match on. You can also generate the event pattern in JSON and test it against a sample event.
For more information on event patterns, see .
To build the event pattern
-
For Event source, choose AWS events or EventBridge partner events.
-
(Optional) In the Sample events section, choose a Sample event type against which you want to test your event pattern.
The following sample event types are available:
-
AWS events – Select from events emitted from supported AWS services.
-
EventBridge partner events – Select from events emitted from third-party services that support EventBridge, such as Salesforce.
-
Enter my own – Enter your own event in JSON text.
You can also use an AWS or partner event as the starting point for creating your own custom event.
Select AWS events or EventBridge partner events.
Use the Sample events dropdown to select the event you want to use as a starting point for your custom event.
EventBridge displays the sample event.
Select Copy.
Select Enter my own for Event type.
Delete the sample event structure in the JSON editing pane, and paste the AWS or partner event in its place.
Edit the event JSON to create your own sample event.
-
-
Choose a Creation method. You can create an event pattern from an EventBridge schema or template, or you can create a custom event pattern.
-
Choose Create archive.
To confirm that events are successfully sent to the archive, you can use the DescribeArchive
operation of the EventBridge API to see if the EventCount
reflects the number of
events in the archive. If it is 0, there are no events in the archive.