

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 通过 Amazon Chime 软件开发工具包 EventBridge 消息自动生成故障警报
<a name="event-bridge-events"></a>

当调用处理器 Lambda 函数出现错误时，Amazon Chime SDK 会发送事件。创建频道流时，无论为处理器指定了什么 `Fallback` 操作，都会发送事件。您可以编写指定此类事件的简单规则，以及当其中任何事件与规则匹配时要执行的自动操作。有关更多信息，请参阅 [Amazon EventBridge 用户指南](https://docs.aws.amazon.com/eventbridge/latest/userguide/)。当出现此类错误时，根据您配置的 `Fallback` 操作，频道中的成员无法发送消息，或者消息将在不经过处理的情况下流经频道。有关 `Fallback` 操作的更多信息，请参阅《Amazon Chime SDK API 参考》中的 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_Processor.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_Processor.html)。

此示例显示了一个典型的故障事件。

```
{
    "version": "0",
    "id": "12345678-1234-1234-1234-111122223333",
    "detail-type": "Chime ChannelFlow Processing Status",
    "source": "aws.chime",
    "account": "111122223333",
    "time": "yyyy-mm-ddThh:mm:ssZ",
    "region": "region",
    "resources": [],
    "detail": {
        "eventType": "ProcessorInvocationFailure",
        "appInstanceArn": "arn:aws:chime:region:AWSAccountId:app-instance/AppInstanceId",
        "channelArn": "arn:aws:chime:region:AWSAccountId:app-instance/AppInstanceId/channel/ChannelId",
        "messageId": "298efac7298efac7298efac7298efac7298efac7298efac7298efac7298efac7",
        "processorResourceArn": "arn:aws:lambda:region:AWSAccountId:function:ChannelFlowLambda",
        "failureReason": "User is not authorized to perform: lambda:InvokeFunction on resource: arn:aws:lambda:region:AppInstanceId:function:ChannelFlowLambda because no resource-based policy allows the lambda:InvokeFunction action"
      }
}
```