

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 EventBridge for Amazon Chime SDK 訊息自動建立失敗提醒
<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"
      }
}
```