

# 使用 Amazon CloudWatch Events 接收 S3 on Outposts 事件通知
<a name="S3OutpostsNotificationsCWE"></a>

您可以使用 CloudWatch Events 为任何 Amazon S3 on Outposts API 事件创建规则。创建规则时，您可以选择通过所有支持的 CloudWatch 目标获得通知，包括 Amazon Simple Queue Service（Amazon SQS）、Amazon Simple Notification Service（Amazon SNS）和 AWS Lambda。有关更多信息，请参阅《Amazon CloudWatch Events 用户指南》**中的[可以作为 CloudWatch Events 目标的 AWS 服务列表](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html)。要选择目标服务以与 S3 on Outposts 结合使用，请参阅《Amazon CloudWatch Events 用户指南》**中的[使用 AWS CloudTrail 创建对 AWS API 调用触发的 CloudWatch Events 规则](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/Create-CloudWatch-Events-CloudTrail-Rule.html)。

**注意**  
对于 S3 on Outposts 对象操作，只有将跟踪（可选带有事件选择器）配置为接收 CloudTrail 发送的 AWS API 调用事件时，这些事件才会匹配您的规则。有关更多信息，请参阅e *AWS CloudTrail《用户指南》* 中的 [使用 CloudTrail 日志文件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-event-selectors-for-a-trail.html)。

**Example**  
以下是 `DeleteObject` 操作的示例规则。要使用此示例规则，请将 `amzn-s3-demo-bucket1` 替换为 S3 on Outposts 桶的名称。  

```
{
  "source": [
    "aws.s3-outposts"
  ],
  "detail-type": [
    "AWS API call through CloudTrail"
  ],
  "detail": {
    "eventSource": [
      "s3-outposts.amazonaws.com"
    ],
    "eventName": [
      "DeleteObject"
    ],
    "requestParameters": {
      "bucketName": [
        "amzn-s3-demo-bucket1"
      ]
    }
  }
}
```