

# Using Event Bridge notifications for Amazon Chime SDK media stream pipelines
<a name="media-stream-event-bridge"></a>

In addition to the [Using Amazon Chime SDK media pipeline events](media-pipe-events.md), media stream pipelines send Event Bridge notifications when they start and stop streaming to KVS, and when video pool states change.

**Topics**
+ [Understanding Amazon Chime SDK media stream pipeline events](stream-pipe-events.md)
+ [Understanding Kinesis Video Streams pool events for Amazon Chime SDK media stream pipelines](media-stream-pool-events.md)

# Understanding Amazon Chime SDK media stream pipeline events
<a name="stream-pipe-events"></a>

Media stream pipelines send the following events. Expand each section to learn more.

## Amazon Chime Media Stream Pipeline Kinesis Video Stream Start
<a name="stream-pipe-kvs-start"></a>

The Amazon Chime SDK media pipeline sends this event when the media stream pipeline starts receiving audio from the meeting and streaming that audio to KVS. Empty `AttendeeId` and `ExternalUserId` fields indicate that the media pipeline sent mixed audio to the KVS stream.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamStart", 
        "timestamp": 1627503649251, 
        "meetingId": "1e6bf4f5-f4b5-4917-b8c9-bda45c340706", 
        "externalMeetingId": "Meeting_Id", 
        "mediaPipelineId": "e40ee45e-2ed1-408e-9156-f52b8208a491", 
        "mediaRegion": "ap-southeast-1",
        
        "attendeeId": "Attendee_Id", 
        "externalUserId": "External_User_Id",
                
        "kinesisVideoStreamArn": "arn:aws:kinesisvideo:us-east-1:123456:stream/Chime*",
        "startFragmentNumber": "1234567899444",
        "startTime": "yyyy-mm-ddThh:mm:ssZ"
                
    }
}
```

## Amazon Chime Media Stream Pipeline Kinesis Video Stream End
<a name="stream-pipe-kvs-stop"></a>

The media pipeline sends this event to Event Bridge when streaming to KVS ends.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamEnd", 
        "timestamp": 1627503649251, 
        "meetingId": "1e6bf4f5-f4b5-4917-b8c9-bda45c340706", 
        "externalMeetingId": "Meeting_Id", 
        "mediaPipelineId": "e40ee45e-2ed1-408e-9156-f52b8208a491", 
        "mediaRegion": "ap-southeast-1",
        
        "attendeeId": "Attendee_Id", 
        "externalUserId": "External_User_Id",
                
        "kinesisVideoStreamArn": "arn:aws:kinesisvideo:us-east-1:123456:stream/Chime*",
        "startFragmentNumber": "1234567899444",
        "startTime": "yyyy-mm-ddThh:mm:ssZ",
        "endTime": "yyyy-mm-ddThh:mm:ssZ",
        "endFragmentNumber": "1234567899555"
    }
}
```

# Understanding Kinesis Video Streams pool events for Amazon Chime SDK media stream pipelines
<a name="media-stream-pool-events"></a>

Media pipelines send the following events to Event Bridge when the pools' states change. Expand each section to learn more.

## Amazon Chime Media Pipeline Kinesis Video Pool Active
<a name="kvs-pool-active"></a>

The media pipeline sends this event is sent after the [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_CreateMediaPipelineKinesisVideoStreamPool.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_CreateMediaPipelineKinesisVideoStreamPool.html) API creates a pool.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline Kinesis Video Pool State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamPoolActive", 
        "timestamp": 1627503649251,
        "mediaRegion": "ap-southeast-1",
        "poolArn" : "ARN of the KVS Pool"
    }
}
```

## Amazon Chime Chime Media Pipeline Kinesis Video Pool Updated
<a name="kvs-pool-updated"></a>

The media pipeline sends this event after the [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_UpdateMediaPipelineKinesisVideoStreamPool.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_UpdateMediaPipelineKinesisVideoStreamPool.html) API updates a pool.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline Kinesis Video Pool State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamPoolUpdated", 
        "timestamp": 1627503649251,
        "mediaRegion": "ap-southeast-1",
        "poolArn" : "ARN of the KVS Pool"
    }
}
```

## Amazon Chime Media Pipeline Kinesis Video Pool Deleted
<a name="kvs-pool-deleted"></a>

The media pipeline sends this event to Event Bridge when the [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_DeleteMediaPipelineKinesisVideoStreamPool.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_DeleteMediaPipelineKinesisVideoStreamPool.html) deletes a pool.

For more information about deleting pools, refer to [Creating a Kinesis Video Streams pool for Amazon Chime SDK media stream pipelines](create-kvs-pool.md), in this section.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline Kinesis Video Pool State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamPoolDeleted", 
        "timestamp": 1627503649251,
        "mediaRegion": "ap-southeast-1",
        "poolArn" : "ARN of the KVS Pool"
    }
 }
```

## Amazon Chime Media Pipeline Kinesis Video Pool Temporary Failure
<a name="kvs-pool-temp-failure"></a>

The media pipeline sends the following event to Event Bridge when a video pool fails temporarily.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline Kinesis Video Pool State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamPoolTemporaryFailure", 
        "timestamp": 1627503649251,
        "mediaRegion": "ap-southeast-1",
        "poolArn" : "ARN of the KVS Pool"
    }
 }
```

## Amazon Chime Media Pipeline Kinesis Video Pool Permanent Failure
<a name="kvs-pool-perm-failure"></a>

The media pipeline sends the following event to Event Bridge when a video pool fails permanently.

```
{
    "version": "0", 
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483", 
    "detail-type": "Chime Media Pipeline Kinesis Video Pool State Change", 
    "source": "aws.chime", 
    "account": "111122223333", 
    "time": "2021-07-28T20:20:49Z", 
    "region": "us-east-1", 
    "resources": [], 
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamPoolPermanentFailure", 
        "timestamp": 1627503649251,
        "mediaRegion": "ap-southeast-1",
        "poolArn" : "ARN of the KVS Pool"
    }
}
```

You will receive the following additional media pipeline event if your AWS account has exceeded its Amazon Kinesis video stream limit.

```
{
    "version": "0",
    "id": "5ee6265a-0a40-104e-d8fd-a3b4bdd78483",
    "detail-type": "Chime Media Pipeline Kinesis Video Pool State Change",
    "source": "aws.chime",
    "account": "111122223333",
    "time": "2021-07-28T20:20:49Z",
    "region": "us-east-1",
    "resources": [],
    "detail": {
        "eventType": "chime:MediaPipelineKinesisVideoStreamPoolStreamLimitExceeded",
        "timestamp": 1627503649251,
        "mediaRegion": "ap-southeast-1",
        "poolArn" : "ARN of the KVS Pool"
    }
}
```