启用 Amazon EventBridge - Amazon Simple Storage Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

启用 Amazon EventBridge

您可以通过 S3 控制台、Amazon Command Line Interface (Amazon CLI) 或 Amazon S3 REST API 启用 Amazon EventBridge。

在 S3 控制台中启用 EventBridge 事件传输。
  1. 登录到Amazon Web Services Management Console,然后通过以下网址打开 Amazon S3 控制台:https://console.aws.amazon.com/s3/

  2. Buckets(存储桶)列表中,请选择要为其启用事件的存储桶的名称。

  3. 选择 Properties (属性)

  4. 导航到 Event Notifications(事件通知)章节,然后找到 Amazon EventBridge 小节。请选择编辑

  5. Send notifications to Amazon EventBridge for all events in this bucket(为此存储桶中的所有事件向 Amazon EventBridge 发送通知)下方,请选择 On(打开)。

    注意

    在启用 EventBridge 后,所做的更改需要大约五分钟才能生效。

以下示例为启用了 Amazon EventBridge 的存储桶 DOC-EXAMPLE-BUCKET1 创建了一个存储桶通知配置。

aws s3api put-bucket-notification-configuration --bucket DOC-EXAMPLE-BUCKET1 --notification-configuration='{ "EventBridgeConfiguration": {} }'

您可以通过调用 Amazon S3 REST API 以编程方式在存储桶上启用 Amazon EventBridge。有关更多信息,请参阅 Amazon Simple Storage Service API Reference 中的 PutBucketNotificationConfiguration

下面的例子展示了在启用 Amazon EventBridge 的情况下,用来创建存储桶通知配置的 XML。

<NotificationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <EventBridgeConfiguration> </EventBridgeConfiguration> </NotificationConfiguration>

创建 EventBridge 规则

启用后,您可以为某些任务创建 Amazon EventBridge 规则。例如,您可以在创建对象时发送电子邮件通知。有关完整的教程,请参阅 Amazon EventBridge User Guide(Amazon EventBridge 用户指南)中的 Tutorial: Send a notification when an Amazon S3 object is created(教程:创建 Amazon S3 对象时发送通知)。