I recently started up an AWS Connect instance from a cloud formation. I want to route the call events to a web server, where I can process each event in real-time and display it to my web app. Here is the general structure:
API Gateway:
- I have endpoints to $connect, $disconnect, and ping.
- I use dynamoDB to dynamically add all the current web socket connection ids (to-be used by the event bridge)
Web server:
- Flask app listening for events from the websocket.
Event Bridge:
- I have an aws connect rule setup to send all Amazon Connect Contact Events to a lamda function. The lamda function reads the event, and sends the event to all the web socket connections using the dynamoDB to get the connection ids.
AWS Connect:
- My inbound call flow configuration is fairly trivial, with a lambda invocation that prints the Contact Flow Events, which includes the caller number (this is important).
Question: The AWS Connect lambda invocation function is receiving the Contact Flow Events with caller number data, but how do I use that caller number data in the Event Bridge rule lambda function? Is there an easy way to associate the two? Technically, because both events share a “contactId” key, I can dump contact flow events into a dynamo db table with short expiration, and retrieve it from the Amazon Connect Contact Event based on the contactId, but is there a more straightforward, lower latency solution? Thanks for the read 🙂