How do I integrate Amazon Connect with Amazon Kinesis?

6 minute read
0

I want to stream contact trace records (CTRs) and agent events from Amazon Connect to Amazon Kinesis.

Short description

Activating data streaming in your Amazon Connect instance lets you stream agent events and CTRs to Amazon Kinesis Data Firehose or Amazon Kinesis Data Streams. Agent events provide near real-time reporting of agent activity within your instance. CTRs provide near real-time data of contact events such as, voice calls, chat, and tasks in your instance.

To integrate Amazon Connect with Kinesis Data Firehose or Kinesis Data Streams, complete the following steps:

  1. Create a Kinesis Data Firehose delivery stream or Kinesis data stream.
  2. Activate data streaming for your instance.
  3. Test your setup.

Resolution

Create a Kinesis Data Firehose delivery stream

To integrate Amazon Connect with Kinesis Data Firehose, complete the following steps:

  1. Configure the source, destination, and name for your Kinesis Data Firehose delivery stream.
    Note: Direct PUT lets you create a Kinesis Data Firehose that can stream data from Amazon Connect without having to create a Kinesis data stream. Kinesis stream requires that you create a Kinesis data stream for your Amazon Connect data.
  2. (Optional) Configure the Kinesis Data Firehose to transform and convert your record data.
  3. (Optional) Configure the backup and advanced settings for your Kinesis Data Firehose delivery stream.
  4. Activate data streaming for your instance.
  5. Test your delivery stream using sample data.

Create a Kinesis data stream

To integrate Amazon Connect with Kinesis Data Streams, complete the following steps:

  1. Create a Stream using the AWS Management Console.
  2. Activate data streaming for your instance.
  3. To test your set-up, complete one of the following sets of steps depending on your use case:

You activated data streaming for contact events:

  1. Place an outbound or inbound call to create a contact record in your instance.
  2. Confirm that the contact record is generated in the Contact search UI.
  3. Check the destination configured in your delivery stream for the contact record event. Contact events are delivered in bulk. You might see multiple contact IDs delivered to the destination at the same time. For an example, see Sample contact event for when a voice call is connected to an agent.

-or-

You activated data streaming for agent events:

  1. Have an agent change their status or connect with a contact to create an agent event.
  2. Check the destination that's configured for the Kinesis data stream for the agent event. The agent ARN is the partition key that's used when data is sent to the data stream. All events for a single agent are sent to the same shard and any resharding events in the stream are ignored. For an example, see Sample agent event stream.

Identifying and troubleshooting errors

I don't see data published in my Kinesis delivery stream destination.

To troubleshoot not seeing data published, take one or more of the following actions:

  • Confirm that the Kinesis data stream that you selected is activated for server-side encryption. If server-side encryption is activated due to lack of permission to call the kms:GenerateDataKey, then Amazon Connect can't publish data to the stream. To resolve this issue, follow the steps in using server-side encryption for Kinesis stream.
  • Test your delivery stream using the Test demo data option in Kinesis Data Firehose to verify that your delivery stream is configured as expected.
  • Review the data delivery frequency for Kinesis Data Firehose. Data delivery frequency might vary depending on the destination that's selected. If five minutes pass and data isn't being delivered, then review the delivery stream metrics for incoming records. You can configure error logging for your Kinesis Data Firehose to capture data delivery errors.

I can't select the Kinesis Data Firehose or Kinesis Data Stream I that created when I activated the data stream for Amazon Connect.

First, confirm that the Kinesis Data Firehose or Kinesis Data Stream exists in the same AWS Region as the Amazon Connect instance. If the services are in the same Region, then there might be a permission missing that allows you to list the stream. Confirm that the following permissions are granted: ListDeliveryStreams for Kinesis Data Firehose, or ListStreams for Kinesis Data Streams.

You can also use the AWS Command Line Interface (AWS CLI) command associate-instance-storage-config to activate data streaming.

Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent AWS CLI version.

Where can I access the agent events or contact trace records (CTRs)?

If agent events and CTRs are sent to Kinesis Data Streams, then use the data viewer in the Kinesis Console to see the data. Also, you can configure a consumer to process the data from the Kinesis data stream. For example, you can create a Kinesis Data Firehose to consume the data from the Kinesis data stream for the agent events.

If CTRs are sent to Kinesis Data Firehose, then the CTRs are accessible in the destination that's configured for the delivery stream. For example, if the destination is an Amazon Simple Storage Service (Amazon S3) bucket, then you can access the CTRs in the chosen S3 bucket. You choose the Amazon S3 destination bucket when you create the Kinesis Data Firehose.

Can I configure more than one Kinesis delivery stream for contact trace records (CTRs)?

By default, only one delivery stream is supported for CTRs. But you can use multiple consumers to have multiple delivery streams for CTRs to a Kinesis Data Stream. To use this configuration, the Kinesis data stream must act as a producer for the CTR data. Then, you can configure multiple consumers to ingest the data. For more information on consumers for Kinesis Data Streams, see Reading data from Amazon Kinesis Data Streams.

I see duplicate data from Amazon Connect published in my Kinesis Data Streams application.

Duplicate data can occur because of producer retries and consumer retries. It's a best practice to have the destination of the final data handle duplicates to be resilient to retries.


Related information

Amazon Connect agent event streams

Amazon Connect contact events

What Is Amazon Kinesis Data Streams?

What Is Amazon Kinesis Data Firehose?

AWS OFFICIAL
AWS OFFICIALUpdated a year ago