# Setting Up AWS Connect with Aisera

This document describes how to add an existing AWS Connect instance to an Aisera application/bot as a Live Agent.

### Pre-requisites <a href="#dpyoivd1a3hp" id="dpyoivd1a3hp"></a>

1. You have a working AWS Connect instance, and have set up flows and Agents.
2. You have the information for your customer’s integration user account. This user account needs to have the correct permission and authorization to access the AWS Connect instance.

   This account needs the following  **IAM permissions** that are required for a user to Integrate with an external Amazon Connect Instance.

```
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Action": [
				"s3:ListAllMyBuckets",
				"connect:StartChatContact",
				"s3:GetBucketLocation"
			],
			"Resource": "*"
		},
		{
			"Effect": "Allow",
			"Action": "s3:GetBucketAcl",
			"Resource": "arn:aws:s3:::amazon-connect-*"
		}
	]
}
```

You need to have the following credentials for this integration user.\
\
&#x20;   A. One of the following options for the AWS Connect Instance:\
\
&#x20;            \- AWS Access Key\
&#x20;            \- AWS Access Key, Secret Key

&#x20;  B. The region, in which this AWS Connect instance is running

&#x20;  C. Contact flow ID of the AWS Connect instance

&#x20;  D. Instance ID of the AWS Connect instance

### Setup Steps <a href="#bgbwoxm9l03k" id="bgbwoxm9l03k"></a>

1. Use the **Settings > Integrations > + New Integration** command in the Aisera Administration application (Admin UI) to create an integration for AWS Connect.

<div align="left"><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FhuK3ENg3MqwOQjQGAX2n%2F0.png?alt=media" alt="" width="563"></div>

2. Add **Basic** authorization for your integration.

<div align="left"><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fzi6vpw1hnxkktoxV01Lk%2F1.png?alt=media" alt="" width="563"></div>

The following table describes the parameters for the fields above.

<table data-header-hidden><thead><tr><th width="159"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Description</strong></td><td><strong>Notes</strong></td></tr><tr><td>Name</td><td>The name of this integration</td><td></td></tr><tr><td>Endpoint</td><td>The URL for your AWS Connect instance</td><td></td></tr><tr><td>Username</td><td>The username for the account that has access to AWS Connect</td><td><p>If this integration is being used for a Live Agent connection, an actual name is not required. Just enter in a random string, such as aaa.</p><p>If this integration is also used for user-specific tasks, like user learning, then enter the actual username.</p></td></tr><tr><td>Password</td><td>The password for the account that has access to AWS Connect</td><td><p>If this integration is being used for a Live Agent connection, an actual password is not required. Just enter in a random string, such as aaa.</p><p>If this integration is also used for user-specific tasks, like user learning, then enter the actual password.</p></td></tr><tr><td>Access Key</td><td>The AWS Access Key for the AWS Connect instance, as described in the pre-requisites</td><td></td></tr><tr><td>Secret Key</td><td>The AWS Secret Key that provides access to the AWS Connect instance, as described in the pre-requisites.</td><td></td></tr><tr><td>Region</td><td>The region where the AWS Connect instance is running, as described in the pre-requisites.</td><td></td></tr><tr><td>Session Name</td><td>The name of the instance session that you use to monitor the logs for AWS Connect..</td><td></td></tr></tbody></table>

### Add the Live Agent to your Aisera App/Bot <a href="#bl7kfu4mz207" id="bl7kfu4mz207"></a>

Use the following procedure to add your Live Agent configuration to your Aisera application or bot.

1. Use the **Settings > AiseraGPT** command to see all of your Aisera applications/bots, and select the one to which you want to add a Live Agent.

   When you select and open your Aisera application/bot, you see the Details (summary) page for your application or bot.
2. Click **+Add Live Agent** if you don’t have an existing Live Agent attached to your application or bot.

   \- or -

   Click **Edit Live Agent** if you already have a live agent integration for your application or bot.
3. Select your AmazonConnect integration, to add this connection to your application or bot.
4. Add the configuration details for your AWS Connect instance.

<div align="left"><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FKyONvhlDbvlIZLhkWhkh%2F2.png?alt=media" alt="" width="563"></div>

The following table provides a description of these parameters.

<table data-header-hidden><thead><tr><th width="208"></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Description</strong></td></tr><tr><td>Contact Flow ID</td><td>The AWS Connect <strong>Contact Flow ID</strong>, as mentioned in the pre-requisites.</td></tr><tr><td>AWS Instance ID</td><td>The <strong>Instance ID</strong> mentioned in the pre-requisites.</td></tr><tr><td>Attachments</td><td>Leave this value as the default of Not Supported.</td></tr></tbody></table>

### Advanced Features <a href="#c49urv1g0lb3" id="c49urv1g0lb3"></a>

The following advanced features are supported for AWS Connect with the Aisera platform.

#### Add Support for Multiple Queues (multiple AWS Contact Flows) - Optional <a href="#bej3nrnhv4tu" id="bej3nrnhv4tu"></a>

In addition to the default contact id, discussed in the Setup steps above, the Aisera platform supports a Pre-process Live Agent Workflow, that allows you to configure multiple contact IDs that the application or bot can select based on the request made by a user.

**To use multiple contact flows:**

1. Select **AI Automation > AI Workflow Studio** in the Aisera Administration application (Admin UI).
2. Choose the **Preprocess Live Agent** workflow.
3. Open the workflow and add a new output variable called contactFlowId and specify that this field contains a String.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FupJIdoMMOGA1R0kWpwhu%2Fnew_output_variable.png?alt=media&#x26;token=f789edbe-7ecf-4bd6-8fe3-7269186c31ae" alt="" width="500"><figcaption></figcaption></figure></div>

4. Add the logic of selecting a contactFlowId to the **Preprocess Live Agent** workflow, using the Workflow Studio canvas.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FQOh7j3Rah9N3AJvDxLDO%2Fworkflow_segment.png?alt=media&#x26;token=0e3fd248-7e86-4930-bc3c-5e4854bc4014" alt="" width="372"><figcaption></figcaption></figure></div>

5. Edit the **User Input** for the new section of the Workflow.

<div align="left"><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fh1TbIX9bU6GIvhA06ToG%2F5.png?alt=media" alt="" width="563"></div>

6. Set the **Output Variable** as shown below.

<div align="left"><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fbr65qjzi2EVGo5FYfXrA%2F6.png?alt=media" alt="" width="563"></div>
