Sending and receiving Amazon EventBridge events between event buses in the same account and Region - Amazon EventBridge
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).

Sending and receiving Amazon EventBridge events between event buses in the same account and Region

You can configure EventBridge to send and receive events between event buses in the same Amazon account and Region.

When you configure EventBridge to send or receive events between event buses, you use IAM roles on the sender event bus to give the sender event bus permission to send events to the receiver event bus. You use Resource-based policies on the receiver event bus to give the receiver event bus permission to receive events from the sender event bus. You can also allow or deny events from certain event buses, specific rules associated with the event bus, or events from specific sources. For more information about event bus permissions, including example policies, see Permissions for Amazon EventBridge event buses.

The steps to configure EventBridge to send events to or receive events between event buses in your account include the following:

  • To use an existing IAM role, you need to give either the sender event bus permissions to the receiver event bus or the receiver event bus permissions to the sender event bus.

  • On the sender event bus, set up one or more rules that have the receiver event bus as the target and create an IAM role. For an example of the policy that should be attached to the role, see Example policy: Send events to an event bus in the same account.

  • On the receiver event bus, edit the permissions to allow events to be passed from the other event bus.

  • On the receiver event, set up one or more rules that match events that come from the sender event bus.

    Note

    EventBridge can't route events received from a sender event bus to a third event bus.

Events sent from one event bus to another are charged as custom events. For more information, see Amazon EventBridge Pricing.

To send events to another event bus, you create a rule with an event bus as a target.

To create a rule that sends events to a different event bus using the console
  1. Open the Amazon EventBridge console at https://console.amazonaws.cn/events/.

  2. In the navigation pane, choose Rules.

  3. Choose Create rule.

  4. Enter a name and description for the rule.

    A rule can't have the same name as another rule in the same Region and on the same event bus.

  5. For Event bus, choose the event bus that you want to associate with this rule. If you want this rule to match events that come from your account, select Amazon default event bus. When an Amazon service in your account emits an event, it always goes to your account’s default event bus.

  6. For Rule type, choose Rule with an event pattern.

  7. Choose Next.

  8. For Event source, choose Amazon services.

  9. (Optional) For Sample events, choose the type of event.

  10. For Event pattern, do one the following:

    • To use a template to create your event pattern, choose Event pattern form and choose the Event source and Event type. If you choose All Events as the event type, all events emitted by this Amazon service will match the rule.

      To customize the template, choose Custom pattern (JSON editor) and make your changes.

    • To use a custom event pattern, choose Custom pattern (JSON editor) and create your event pattern.

  11. Choose Next.

  12. For Target types, choose EventBridge event bus and choose Event bus in the same Amazon account and Region.

  13. For Event bus as a target, select an event bus from the drop-down list.

  14. For Execution role, to have EventBridge create a new IAM role that has permissions to send events to the specified event bus, choose Create a new role for this specific resource.

  15. (Optional) For Additional settings, do the following:

    1. For Dead-letter queue, choose whether to use a standard Amazon SQS queue as a dead-letter queue. EventBridge sends events that match this rule to the dead-letter queue if they are not successfully delivered to the target. Do one of the following:

      • Choose None to not use a dead-letter queue.

      • Choose Select an Amazon SQS queue in the current Amazon account to use as the dead-letter queue and then select the queue to use from the drop-down list.

      • Choose Select an Amazon SQS queue in an other Amazon account as a dead-letter queue and then enter the ARN of the queue to use. You must attach a resource-based policy to the queue that grants EventBridge permission to send messages to it. For more information, see Granting permissions to the dead-letter queue.

  16. (Optional) Choose Add another target to add another target for this rule.

  17. Choose Next.

  18. (Optional) Enter one or more tags for the rule. For more information, see Amazon EventBridge tags.

  19. Choose Next.

  20. Review the details of the rule and choose Create rule.