0

Navigate to the bottom of Amazon docs for retrieving Contact Events from Amazon Connect. You will see two samples of Contact Events, one "wrapped" -- presumably because it is a source event that enters the default event bus -- and one "unwrapped". Which of these schema is actually dispatched to the EventBridge target?

"Wrapped" schema:

{
    "version": "0",
    "id": "abcabcab-abca-abca-abca-abcabcabcabc",
    "detail-type": "Amazon Connect Contact Event",
    "source": "aws.connect",
    "account": "111122223333",
    "time": "2021-08-04T17:43:48Z",
    "region": "us-west-1",
    "resources": [
        "arn:aws:...", 
        "contactArn", 
        "instanceArn"
    ],
    "detail": {
        "eventType": "DISCONNECTED",
        "contactId": "11111111-1111-1111-1111-111111111111",
        "initialContactId": "11111111-2222-3333-4444-555555555555",
        "previousContactId": "11111111-2222-3333-4444-555555555555",
        "channel": "Voice",
        "instanceArn": "arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012",
        "initiationMethod": "OUTBOUND",
        "initiationTimestamp":"2021-08-04T17:17:53.000Z",
        "connectedToSystemTimestamp":"2021-08-04T17:17:55.000Z",
        "disconnectTimestamp":"2021-08-04T17:18:37.000Z",
        "queueInfo": {
            "queueArn": "arn",
            "queueType": "type",
            "enqueueTimestamp": "2021-08-04T17:29:04.000Z"
        },
        "AgentInfo": {
            "AgentArn": "arn",
            "connectedToAgentTimestamp":"2021-08-04T17:29:09.000Z"
        },
        "CustomerVoiceActivity": {
           "greetingStartTimestamp":"2021-08-04T17:29:20.000Z",
           "greetingEndTimestamp":"2021-08-04T17:29:22.000Z",
        }
    }
}

"Unwrapped" schema:

{
"initiationTimestamp":"2021-08-04T17:17:53.000Z",
"contactId":"11111111-1111-1111-1111-111111111111",
"channel":"VOICE",
"instanceArn":"arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012",
"initiationMethod":"INBOUND",
"eventType":"CONNECTED_TO_AGENT",
"agentInfo":{
  "agentArn":"arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/agent/12345678-1234-1234-1234-123456789012",
  "connectedToAgentTimestamp":"2021-08-04T17:29:09.000Z"
},
"queueInfo": {  
    "queueType":"type",
    "queueArn":"arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/queue/12345678-1234-1234-1234-123456789012",
    "enqueueTimestamp":"2021-08-04T17:29:04.000Z"
  }
}
Kode Charlie
  • 1,297
  • 16
  • 32

1 Answers1

1

Events published through the EventBus should always contain Event Source and Detail Type, along with other fields such as id, version, account number, and so on. These values will help to identify the origin of the events.

In an EventBridge rule, when the events match the event pattern, the same event will be forwarded to the specified Target. Therefore, you always receive the complete event (wrapped) on the target side.

The actual aws-connect event can be found inside the Detail section. You can easily test this pattern by connecting your EventBridge rule to SQS, and then you can inspect the messages in SQS to see the actual event that you received.

codeninja.sj
  • 3,452
  • 1
  • 20
  • 37
  • Thanks for the clarification. One other nit: the docs (in the link in my original post) capitalize all properties in the Contact Event model. But then in the examples (also cited in my original post), most of those properties start with a lower-case. It would help if both docs and examples were case-consistent. – Kode Charlie Sep 01 '23 at 02:55