Project: Automate migration of Amazon Connect Contact flows from one Instance to another

This will be a short post about one of my side projects which I recently completed. This post is a description and workings of an utility which will help automate the process of migrating Contact flows from one Amazon Connect instance to another.

Currently the process of Amazon Connect Contact flow migration is very manual where developers have to export the flows from one instance and import on another instance manually. So this utility will help automate the process of exporting and importing with just few clicks. A video about the utility in action can be found Here.

A Github repo for the app and a Terraform module to deploy the whole app, will be available soon as I complete those for public usage.

App Functionality

Let me first go through what does the app handle. Below is a high level flow of the app functionality and what each step does. Below flow should explain how the app works overall end to end.


Here are the features which are part of the current state of the application:

  • Login to the application using Cognito
  • Select Contact flow from source Instance, which will be deployed to target environment. Source instance selected from list of Amazon Connect instances enabled in the Source AWS account
  • Provide Key and Amazon Connect instance details for the destination deployment. Store details in Secrets Manager
  • Deploy Contact flow to the Destination instance. The selected Contact flow from the source environment is deployed to the destination environment

Tech Architecture

Let me go through the overall architecture of the application. Below image will show the whole architecture.


Here are the main components of the app architecture:

  • Front End:

    Frontend is a React app which handles all the user interactions. The React app files are deployed to an S3 bucket and served to end users via a Cloudfront distribution. The whole frontend is deployed as a Terraform module to automate the deployment.

  • Security Components:

    The app is secured by an authentication layer and and an user is needed to login before being able to handle deployments. Whole authentication is handled using AWS Cognito. Frontend, API Gateway and Lambda all of the components are secured behind a Cognito Authentication. Authentication components are also deployed via a custom Security Terraform module. There is also Secrets manager involved to store the keys as secrets which are needed for deploying to destination instance.

  • Backend:

    Backend consist of a Lambda and a DynamoDb table. The Lambda is a Python Flask API which exposes various endpoints for the different app tasks. Lambda communicates with Amazon Connect API for the different functions like Creating Contact flows, reading flow details etc. The Dynamodb table stores all the deployment related details. The Lambda is exposed to the frontend via an API Gateway. Whole backend is also deployed as a custom Terraform module.

That should cover the whole architecture of the app.


This project in its current state handles very basic migration tasks for the Contact flows. I am working to enhance the app with new and enhanced features. Some of the new features to note below:

  • Replace Lambda ARNs in destination Contact flow while deploying
  • Handle Lex changes during deployment
  • Add flexibility to parameterize source and destination instances for deployment
  • Add CLI capability


Hope this short post provided some explanation about my side project. This whole project will be made available as a Terraform module which anyone can use to deploy the whole setup. The module details and the Github repo for this will be coming soon. Meanwhile if you have any questions, please reach out to me from the Contact page.



Cloud architect and DevOps engineer. Love to code and develop new stuff. A nerd by nature.

Read More