Build a multi-region resilient contact center with Amazon Connect global resiliency
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.
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:
- 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.
- 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.).
- 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.
For this walkthrough, it is assumed that you understand and have access to the following resources:
- 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.
- An existing Amazon Connect instance that is SAML enabled.
- 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.
- AWS IAM to create policies and roles.
- Amazon CloudFront to create a distribution.
- Amazon S3 to create buckets.
- 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:
- Deploy the CloudFormation stack.
- 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
- Log in to the AWS Management Console in the US West (Oregon) Region.
- Choose the Launch Stack button to create a stack .
- Enter a unique stack name (e.g. test-acgr-capability-stack).
- 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.
- CloudFront URL. (see figure below).
- Check the box for “I acknowledge that AWS CloudFormation might create IAM resources.”
- Choose Create Stack.
- 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.
- 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
- Navigate to the Outputs section of the newly created stack.
- Copy the CloudFrontEndpoint URL from the Value column.
- 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:
- PILLAR A – API Pillar: This lists all the APIs that can be exercised for the Amazon Connect Global Resiliency capability.
- 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’).
- 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’).
- 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:
- Set up the primary Amazon Connect environment with SAML.
- Navigate to the CloudFront endpoint URL.
- Choose AWS Configurations.
- Enter the Access Key and Secret Key for your AWS account.
- Enter the Instance ID for the primary Amazon Connect instance.
- Enter the corresponding Region.
- 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’.
- Click on the button Replicate Instance in the API Pillar.
- 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).
- Hit Create Replica.
- The API output is displayed in the JSON Pillar. Instance creation status is seen in the Amazon Connect instance page.
- 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.
- Choose Type, either DID or TFN.
- 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).
- Enter a Prefix. The API will try to retrieve numbers with that prefix based on available inventory.
- Enter a Description.
- 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‘).
- Choose Search phone number(s). This populates the Phone Number dropdown – the result of the API query is shown alongside in JSON Output.
- 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.
- API Output is shown in the JSON Pillar.
- 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
- 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
- Select a phone number by choosing it from the Phone Number Pillar.
- 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
- Select ‘Create TDG’.
- Enter a name for the TDG and optionally enter a Description.
- Hit ‘Create’.
- 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
- Select a TDG from the TDG Pillar.
- Click on Describe TDG in the API Pillar.
- The JSON Pillar displays the output of API invocation – it provides details about the TDG that was selected.
Button: Update Phone Number
- Select a phone number in the Phone Number Pillar.
- Choose Update phone number in the API pillar.
- 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.
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
- Choose List TDGs from the API Pillar to list all available TDGs.
- Select a TDG from the TGD Pillar.
- Choose List Phone Numbers by TDG from the API Pillar.
- The list of phone numbers allocated to this TDG are shown in the Phone Number Pillar.
- API output is shown in the JSON Pillar.
Button: Allocate Traffic
API to distribute traffic in percentages across a TDG
- Select a TDG from the TDG Pillar.
- Choose Get TDG from the API Pillar.
- 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.
- Choose Update.
- API execution results are shown in the JSON Pillar. The result must show the assigned traffic allocation.
Button: Delete TDG
- Click on Delete TDG in the API Pillar.
- Select ‘Yes’ in the confirmation dialog box.
- The results of invoking the API are shown in the JSON Pillar.
- 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:
- To issue List Phone numbers by TDG, select a TDG from the TDG Pillar and select a phone number from the Phone Number pillar.
- Issue the Release phone number API from the API Pillar.
- The JSON Pillar provides an output from invoking the API and the UI presents a message box showing the number has been released.
- 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.
To avoid incurring future charges:
- Remove all the contents in the Amazon S3 bucket that you created.
- Delete the S3 bucket.
- Remove all created resources by deleting the AWS CloudFormation stack.
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.