April 5, 2021

Connect Escalation

Connect is a really interesting product with some interesting use cases. I had one come up recently about how to provide an escalated paging service. We needed to restrict access to only Australian mobiles and wanted to also validate that the mobile user was at least some what real. Finally we send a page via Opsgenie. - If you wish to use an alternative service, update the code to your provider.

Code is available on Github.

Escalation Contact flow

I’ll explain what is going on in this Contact flow with a simplified flow diagram:

Connect Escalation Flow

To get this operating you need an AWS account with an Amazon Connect instance setup. I’ve created a deploy.sh script to make the process really simple, but you need to have enough access to the services being used and CloudFormation. There are many ways to setup the CLI, and is out of scope for this post though.

Before you deploy the CloudFormation, you need to setup Connect.

In the AWS Console browse to the Connect console, pick a domain and provision a new instance.

Once this is complete, you need to grab the ARN of the instance.

For the Opsgenie API Key you need to configure an API integration with create access for alerts.

Once you have these two pieces of information, decide on stack name and set the following shell varialbes:

export CONNECT_ARN="arn:aws:connect:ap-southeast-2:123456789012:instance/11111-11111-111111-111111"
export OPSGENIE_KEY="abc123"
export STACK_NAME=connectescalation

Once you’ve done that, you can execute deploy.sh.

This will deploy the Lambda functions, setup all the correct permissions and deploy the Lambda code.

It will also setup the Contact flow ready to be imported.

In the Connect instance, create a new contact flow. On the empty screen, under the Save menu, select import and choose the Escalation.json file.

Save and publish.

Now go to numbers and allocate a number and assign the Escalation contact flow to this number.

Your Emergency Paging Escalation connect flow is ready for testing.

Note; it took a few minutes and another round of publishing for the number to work, so just be aware of this.

© Greg Cockburn

Powered by Hugo & Kiss.