AWS Contact Center

Build a multi-region resilient contact center with Amazon Connect global resiliency

Overview

Businesses and enterprises that offer customer service are often required to support their customers 24/7. This makes it possible for businesses to handle urgent and important calls, and provides customers the option to call in at their convenience.  When support services aren’t available or they fall offline, businesses are at risk of customers getting disconnected, or worse, losing customer trust. As a mitigation step, businesses typically design fault tolerant workloads to achieve continuity objectives. Such workloads are designed to shield customers from any impact arising from infrastructure outages. Designing fault tolerant workloads requires businesses to provision backup or redundant services that are reachable when primary services are unavailable.

Amazon Connect now provides Amazon Connect Global Resiliency which is a set of API operations to programmatically provision Amazon Connect in two Regions (a primary and secondary). It also includes APIs that allow distribution of incoming phone calls across Regions. In this blog post, we will walk you through setting up a sample user interface that can be used to invoke each API that has been released for this feature.

Solution

The solution presented in this blog post wraps around the Amazon Connect Global Resiliency APIs and provides a user interface to exercise their functionality. The solution includes an AWS Cloud Formation Template that deploys a website. This website allows an administrator to:

  1. Automatically create an empty replica of their current active instance in a linked Region and associates both of the instances in a single Instance Group.
  2. Create a Traffic Distribution Group (TDG) to distribute and shift telephony traffic across Regions. The API allows traffic to be redirected 100% or shifted in 10% increments (for example, 100%/0%, 50%/50%, 40%/60% etc.).
  3. Use Amazon Connect phone number management APIs to claim and manage phone numbers.

When deployed using the provided AWS CloudFormation template, the solution creates an Amazon S3 bucket and loads all assets into Amazon CloudFront. The CloudFront distribution provides an administration UI demonstrating how the API functionality is exercised. Refer to the following diagram for deployment steps.

Note: This is a sample project designed to be easily deployed for experimentation. The Identity Access Management (IAM) policy permissions use least privilege. However, the Amazon CloudFront resources deployed will be publicly accessible. Please take the appropriate measures to secure your CloudFront distribution.

Prerequisites

For this walkthrough, it is assumed that you understand and have access to the following resources:

  1. An AWS account that has been allow-listed to use the Amazon Connect Global Resiliency APIs. Please work with your AWS Account Manager to get your account allow listed for this feature.
  2. An existing Amazon Connect instance that is SAML enabled.
  3. Phone numbers claimed in your Amazon Connect instance NOTE: Amazon Connect Global Resiliency is currently only available in Amazon Connect instances located within the US.
  4. AWS IAM to create policies and roles.
  5. Amazon CloudFront to create a distribution.
  6. Amazon S3 to create buckets.
  7. AWS CloudFormation to run the stack.

Deploy the solution

Note: The CloudFormation template will deploy resources in the US-West-2 (Oregon) Region. To deploy in other Regions, download the solution from this GitHub repository.

Overview of the steps:

The solution deployment consists of the following two steps:

  1. Deploy the CloudFormation stack.
  2. Test the APIs exposed by the User Interface (UI) for managing your Amazon Connect Regions.

The sections below detail these steps:

Deploy the CloudFormation stack

  1. Log in to the AWS Management Console in the US West (Oregon) Region.
  2. Choose the Launch Stack button to create a stack launch stack button.
  3. Enter a unique stack name (e.g. test-acgr-capability-stack).
  4. Under Amazon S3 configuration, enter a globally unique name for a new Amazon S3 bucket that will be created (e.g. myUser-MM-DD-YYYY-test-mrr-capability-stack). This bucket will store all the assets that are required for the web UI you access through the Amazon.
  5. CloudFront URL. (see figure below).
  6. Check the box for “I acknowledge that AWS CloudFormation might create IAM resources.
  7. Choose Create Stack.
  8. The AWS CloudFormation template may take 15 to 30 minutes to create all the resources. Once done, it will show the status as CREATE_COMPLETE.
  9. It may take another 15 to 20 minutes for Amazon CloudFront to complete its deployment of the website assets after the status changes to CREATE_COMPLETE.

Test the API’s exposed by the User Interface (UI) for managing your Amazon Connect Regions

  1. Navigate to the Outputs section of the newly created stack.
  2. Copy the CloudFrontEndpoint URL from the Value column.
  3. Paste the URL in a new web browser tab or window to navigate to newly deployed User Interface.

User Interface layout

The User Interface is laid out as follows:

  1. PILLAR A – API Pillar: This lists all the APIs that can be exercised for the Amazon Connect Global Resiliency capability.
  2. PILLAR B – TDG Pillar: Traffic Distribution Groups (TDG). This pillar returns TDGs (for example, select the button ‘List TDGs’ to populate the pillar with the TDGs defined for your instance). This pillar also allows you to select a TDG to issue an API call that requires TDG as an input – for example, ‘List Phone Numbers by TDG’).
  3. PILLAR C – Phone Number Pillar: This returns a list of phone numbers and also allows you to select a phone number for APIs that require a phone number as a parameter (for example, ‘Describe phone number’).
  4. PILLAR D – JSON Pillar – This provides a visual output of the JSON returned as a result of calling any of the APIs noted in PILLAR A.

There are multiple possible ways to call the APIs using the User Interface provided in this blog post. One such path is noted in the following diagram.

User Interface Guide / API Invocation

Button: AWS Configurations:

  1. Set up the primary Amazon Connect environment with SAML.
  2. Navigate to the CloudFront endpoint URL.
  3. Choose AWS Configurations.
  4. Enter the Access Key and Secret Key for your AWS account.
  5. Enter the Instance ID for the primary Amazon Connect instance.
  6. Enter the corresponding Region.
  7. Choose Save Configurations.

The remaining sections of this blog post walk through the APIs and how to exercise their functionality.

Button: Replicate Instance

This button exposes functionality to replicate the primary instance. While there is no enforced naming convention for the secondary instance, it is a good idea to name it similar to the primary to help readability. As an example, if the primary is named ‘my-amazon-connect-primary-instance’, the secondary may be named ‘my-amazon-connect-secondary-instance’.

Action:

  1. Click on the button Replicate Instance in the API Pillar.
  2. Provide a name for the replica and a Region (note that we currently only support US-EAST-1 and US-WEST-2 Regions for replication).
  3. Hit Create Replica.

Outputs:

  1. The API output is displayed in the JSON Pillar. Instance creation status is seen in the Amazon Connect instance page.
  2. Note that instance creation can take 5 to 8 minutes. The instance status shows up as Pending in the Amazon Connect Console.

Button: Claim a phone number

This button exposes functionality to claim a toll-free number (TFN) or a direct inward dial (DID) number from Amazon Connect. Numbers claimed can directly be mapped to a Traffic Distribution Group (TDG) or be mapped to the instance selected in the AWS Configuration.

Inputs:

  1. Choose Type, either DID or TFN.
  2. Choose Country, either US or any other supported country, as applicable (Note: MRR is currently only available in US-EAST-1 and US-WEST-2 Regions).
  3. Enter a Prefix. The API will try to retrieve numbers with that prefix based on available inventory.
  4. Enter a Description.
  5. Choose the Traffic Distribution Group (TDG) that the phone number will be mapped to. NOTE: Leaving the TDG field blank will map a claimed phone number to the Amazon Connect instance that was entered during setup (see above under ‘AWS Configurations‘).
  6. Choose Search phone number(s). This populates the Phone Number dropdown – the result of the API query is shown alongside in JSON Output.

Outputs:

  1. Click the dropdown box ‘Phone Number’ to view the numbers that the API returned, and then select a number from the list of numbers by clicking Claim phone number.
  2. API Output is shown in the JSON Pillar.

Action:

  1. Choose ‘Claim phone number’ to claim a phone number and have it assigned automatically to either a TDG (selected in the previous step) or to the instance configured previously.

Button: List Phone Numbers

Action:

  1. Click on List Phone Numbers – This lists the phone numbers allocated to the instance. The phone number listing is also displayed in the JSON Pillar.

Button: Describe phone number

This button describes the properties of the phone number. The properties are displayed in the JSON Pillar

Action:

  1. Select a phone number by choosing it from the Phone Number Pillar.
  2. Select Describe Phone Number. This invokes the API, and the results are shown in the JSON Pillar.

The JSON Output shows the Amazon Connect instance (TargetARN) that the selected phone number has been mapped to, in addition to other properties of the phone number.

Button: Create TDG

This button creates a traffic distribution group

Action:

  1. Select ‘Create TDG’.
  2. Enter a name for the TDG and optionally enter a Description.
  3. Hit ‘Create’.

Output:

  1. The TDG Pillar reflects the state of the API operation (For example, ‘CREATION_IN_PROGRESS’), and the JSON Pillar shows the output from invoking the API.

Button: Describe TDGs

Action:

  1. Select a TDG from the TDG Pillar.
  2. Click on Describe TDG in the API Pillar.

Output:

  1. The JSON Pillar displays the output of API invocation – it provides details about the TDG that was selected.

Button: Update Phone Number

Action:

  1. Select a phone number in the Phone Number Pillar.
  2. Choose Update phone number in the API pillar.
  3. Choose Update alongside the Instance ARN to map the phone number to an instance OR choose Update alongside TDG to map the number to a TDG.

Result:

UI shows that the API has completed correctly.

For the given example, we have mapped the phone number to a TDG that was already created in earlier steps.

Button: List Phone Numbers by TDG

Action:

  1. Choose List TDGs from the API Pillar to list all available TDGs.
  2. Select a TDG from the TGD Pillar.
  3. Choose List Phone Numbers by TDG from the API Pillar.

Output:

  1. The list of phone numbers allocated to this TDG are shown in the Phone Number Pillar.
  2. API output is shown in the JSON Pillar.

Button: Allocate Traffic

API to distribute traffic in percentages across a TDG

Action:

  1. Select a TDG from the TDG Pillar.
  2. Choose Get TDG from the API Pillar.
  3. Allocate a percent of traffic across both the Regions in the dialog box in increments of 10%. For example, 10% to us-east-1 and 90% to us-west-2.
  4. Choose Update.

Output:

  1. API execution results are shown in the JSON Pillar. The result must show the assigned traffic allocation.

Button: Delete TDG

Action:

  1. Click on Delete TDG in the API Pillar.
  2. Select ‘Yes’ in the confirmation dialog box.

Output:

  1. The results of invoking the API are shown in the JSON Pillar.
  2. If there were numbers (TFN or DID) assigned to the TDG, the system reports an error, as the numbers must be released before deleting the TDG. To release the number:
    1. To issue List Phone numbers by TDG, select a TDG from the TDG Pillar and select a phone number from the Phone Number pillar.
    2. Issue the Release phone number API from the API Pillar.
    3. The JSON Pillar provides an output from invoking the API and the UI presents a message box showing the number has been released.
    4. Attempt to delete the TDG again – This time, when the API request is issued, the TDG Pillar shows the status as ‘PENDING_DELETION’ and the JSON Pillar shows the API output, which reflects the same.

Amazon Connect: Global Resiliency – Onboarding patterns

Access to the Global Resiliency API is currently gated. Please engage with your account team for more details. Every customer’s onboarding requirements can be different, however, a typical on-boarding process is noted in the following diagram.

Cleanup

To avoid incurring future charges:

  1. Remove all the contents in the Amazon S3 bucket that you created.
  2. Delete the S3 bucket.
  3. Remove all created resources by deleting the AWS CloudFormation stack.

Conclusion

This post demonstrated examples of how one can use Amazon Connects’ new Global Resiliency (GR) APIs to programmatically manage resiliency operations and provision Amazon Connect in two Regions. To learn more about how this solution was built and see how the APIs were performed, refer to the GitHub repository.