AWS Eventbridge: Pattern to capture ALL events

Viewed 6177

I'd like to deploy an AWS Event Rule in Eventbridge which is triggered by all events, with no filtering whatsoever.

I've tried the following patterns with no luck.

{
source: ["*"]
}

According to the documentation you cannot leave the pattern empty. Also, any fields not included in the pattern are wildcarded meaning they can be any value.

I've read articles saying Eventbridge can replace services such as SNS and SQS but without these finer controls I don't see that happening.

Thanks

4 Answers

Based on the comments.

The solution was to use empty prefix to match all events:

{
"source": [{"prefix": "" }]
}

My favorite was { "version": ["0"] }

Using serverless framework you can use the following event pattern to receive ALL events from the bus eventBusName for your account with ID accountID:

  - eventBridge:
      eventBus: arn:aws:events:${aws:region}:${aws:accountId}:event-bus/eventBusName
      pattern:
        account: ["accountID"]
Related