Skip to main content

How to Integrate Reality Defender with Amazon Connect

This guide covers the end-to-end configuration required to integrate Amazon Connect with Reality Defender, including live media streaming, contact flow setup, SQS queue configuration, and IAM permissions.

A
Written by Aphrodite Brinsmead
Updated over a week ago

Prerequisites

Before beginning, ensure you have:

  • An active AWS account with administrator access

  • An existing Amazon Connect instance

  • Reality Defender credentials and your assigned IAM role details

  • Familiarity with the AWS Management Console


Step 1: Enable Live Media Streaming in Amazon Connect

This step configures Amazon Connect to stream live call audio to Kinesis Video Streams, which Reality Defender will consume for analysis.

  1. Log in to the AWS Management Console.

  2. Navigate to Amazon Connect and select your instance.

  3. In the left-hand menu, click Data storage.

  4. Under Live media streaming, click Enable live media streaming.

  5. Enter a Prefix for the Kinesis Video Streams that will store the media (e.g., voiceguard-connect-realitydefender-contact-).

  6. Set your preferred Data retention period to control how long streams are retained.

  7. Save your changes.

Note: The prefix you choose here must match the ARN pattern configured in the IAM policy in Step 5.


Step 2: Configure the Amazon Connect Contact Flow

This step sets up a contact flow that initiates media streaming and captures the metadata Reality Defender needs to locate and process each call's audio stream.

  1. Log in to your Amazon Connect instance via the AWS Management Console.

  2. In the left-hand menu, navigate to Routing → Flows.

  3. Select an existing contact flow or click Create flow.

  4. In the flow designer, drag and drop a Start media streaming block to the point in the flow where streaming should begin.

  5. Add a Set contact attributes block immediately after.

  6. In the Set contact attributes block, configure the following dynamic attributes:

Media Stream attributes:

Namespace

Key

Media streams

Customer audio start fragment number

Media streams

Customer audio stream ARN

Media streams

Customer audio start timestamp

System attributes:

Namespace

Key

System

Customer endpoint address

System

Dialed number

  1. Continue building out the remainder of the flow with any transfer or routing logic required for your business needs.

  2. Save and publish the flow.


Step 3: Create an Amazon SQS Queue

Reality Defender uses an SQS queue to receive notifications about new and updated calls from Amazon Connect. This step creates that queue.

  1. In the AWS Management Console, navigate to Amazon Simple Queue Service (SQS).

  2. Click Create queue.

  3. Configure the queue:

    • Name: Enter a name for the queue (e.g., connect).

    • Type: Select Standard for high throughput, or FIFO if strict message ordering is required.

  4. Optionally configure additional attributes such as Message Retention Period, Visibility Timeout, Delivery Delay, and Access Policies.

  5. Click Create queue.

Keep note of the queue's ARN — you will need it in Steps 4 and 5.


Step 4: Configure Amazon EventBridge to Route Connect Events to SQS

This step creates an EventBridge rule that listens for specific Amazon Connect call events and forwards them to the SQS queue created in Step 3.

  1. In the AWS Management Console, navigate to Amazon EventBridge.

  2. Click Create rule.

  3. Provide a Name (e.g., ConnectCallNotifications) and optional description.

  4. Under Event bus, leave the selection as Default.

  5. Select Event Pattern as the rule type.

  6. Under Service provider, select AWS. Set Event source to Amazon Connect and Event type to Amazon Connect Contact Event.

  7. Switch to Custom pattern (JSON editor) and paste the following:

{
"source":["aws.connect"],
"detail-type":["Amazon Connect Contact Event"],
"detail":{"eventType":["INITIATED", "CONTACT_DATA_UPDATED"]
}
}
  1. Under Target, click Add target.

  2. Set Target type to SQS Queue and select the queue created in Step 3.

  3. If prompted, allow EventBridge to create or assign a role with permission to write to the SQS queue.

  4. Review the configuration and click Create.


Step 5: Configure IAM Permissions for Reality Defender

This step grants Reality Defender the minimum necessary permissions to access Kinesis Video Streams, consume messages from SQS, and retrieve contact attributes from Amazon Connect.

Required Permissions by Service

Kinesis Video Streams

KVS permissions allow Reality Defender to access and manage audio streams captured during calls in Amazon Connect. Because all streams share a similar naming pattern, a catch-all prefix is used to scope access appropriately.

Permission

Purpose

kinesisvideo:GetMedia

Retrieve audio stream data for analysis

kinesisvideo:ListStreams

Identify active streams

kinesisvideo:DescribeStream

Access stream metadata and state

Resource specification: Permissions are scoped to streams matching the prefix set in Step 1. Example ARN: arn:aws:kinesisvideo:*:*:stream/voiceguard-connect-realitydefender-contact-*

Amazon SQS

SQS permissions allow Reality Defender to consume and manage messages from the queue created in Step 3. These messages notify Reality Defender of new incoming calls or updates to a call's state.

Permission

Purpose

sqs:ReceiveMessage

Consume call notifications from the queue

sqs:DeleteMessage

Remove processed messages from the queue

sqs:SendMessage

Send messages to the queue

sqs:ChangeMessageVisibility

Manage message visibility for delayed processing

Resource specification: Permissions are restricted to the specific SQS queue created for this integration. Example ARN: arn:aws:sqs:<region>:<account-id>:connect

Amazon Connect

The GetContactAttributes API allows Reality Defender to retrieve metadata about each call — such as the stream ARN, fragment number, and timestamps — which are required to locate and process the correct audio stream.

Permission

Purpose

connect:GetContactAttributes

Retrieve call metadata such as stream ARN and timestamps

Resource specification: This permission is limited to your specific Amazon Connect instance. Example ARN: arn:aws:connect:<region>:<account-id>:instance/<instance-id>

IAM Policy

Once the required permissions are defined, create an IAM policy and attach it to a role that Reality Defender can assume. This keeps access secure and limited to only the actions and resources required for the integration to function.

Create a new IAM policy using the JSON below. Replace all placeholder values (<region>, <account-id>, <instance-id>) with your actual values before applying.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:SendMessage",
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"sqs:ChangeMessageVisibility"
],
"Resource": "arn:aws:sqs:<region>:<account-id>:connect"
},
{
"Effect": "Allow",
"Action": [
"kinesisvideo:GetMedia",
"kinesisvideo:ListStreams",
"kinesisvideo:DescribeStream"
],
"Resource": "arn:aws:kinesisvideo:*:*:stream/voiceguard-connect-realitydefender-contact-*"
},
{
"Effect": "Allow",
"Action": "connect:GetContactAttributes",
"Resource": "arn:aws:connect:<region>:<account-id>:instance/<instance-id>"
}
]
}

Attach the Policy to a Role

  1. In the AWS Management Console, navigate to IAM → Roles.

  2. Create a new role or select an existing one designated for Reality Defender.

  3. Attach the policy created above to the role.

  4. Provide Reality Defender with the Role ARN so it can assume the role and access the required resources.


Summary

Once all steps are complete, the following will be in place:

Component

Purpose

Amazon Connect — Live Media Streaming

Streams call audio to Kinesis Video Streams

Contact Flow

Captures stream ARN, fragment number, and timestamps as contact attributes

Amazon SQS Queue

Receives call event notifications from EventBridge

Amazon EventBridge Rule

Forwards INITIATED and CONTACT_DATA_UPDATED events to SQS

IAM Policy & Role

Grants Reality Defender scoped access to KVS, SQS, and Connect

If you encounter any issues during setup, please contact Reality Defender Support.

Did this answer your question?