Skip to main content

Prerequisites

  • An active Amazon Connect instance
  • Access to the AWS Management Console
  • A PolyAI Agent Studio project with purchased phone numbers
  • Permissions to create IAM roles, Lambda functions, DynamoDB tables, and CloudFormation stacks

Step 1: Download the CloudFormation Template

Download the CloudFormation template from the link below and save it locally:
https://polyai-amazon-connect-cloudformation-artifacts-us-east-1.s3.us-east-1.amazonaws.com/template/v2/20250930-102558-addb90276bd7525c035aceff522df40e2d75a933/cloudformation.json

Step 2: Create an IAM Role

Create an IAM role with the permissions required to deploy and manage the PolyAI integration resources.
  1. In the AWS Console, navigate to IAM → Roles → Create role
  2. Create a role with the policy below
  3. Replace <aws_account_id> with your AWS account ID
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CloudFormationPermissions",
      "Effect": "Allow",
      "Action": [
        "cloudformation:DescribeStackEvents",
        "cloudformation:CreateStack",
        "cloudformation:GetTemplate",
        "cloudformation:DeleteStack",
        "cloudformation:DescribeStackResources",
        "cloudformation:UpdateStack",
        "cloudformation:DescribeStacks",
        "cloudformation:ValidateTemplate"
      ],
      "Resource": "arn:aws:cloudformation:*:<aws_account_id>:stack/*"
    },
    {
      "Sid": "DynamoDBPermissions",
      "Effect": "Allow",
      "Action": [
        "dynamodb:CreateTable",
        "dynamodb:UpdateTimeToLive",
        "dynamodb:TagResource",
        "dynamodb:UntagResource",
        "dynamodb:DescribeTable",
        "dynamodb:DescribeTimeToLive",
        "dynamodb:DeleteTable",
        "dynamodb:UpdateTable"
      ],
      "Resource": "arn:aws:dynamodb:*:<aws_account_id>:table/PolyAI*"
    },
    {
      "Sid": "IAMPermissions",
      "Effect": "Allow",
      "Action": [
        "iam:GetRole",
        "iam:PassRole",
        "iam:DetachRolePolicy",
        "iam:DeleteRolePolicy",
        "iam:TagRole",
        "iam:CreateRole",
        "iam:DeleteRole",
        "iam:AttachRolePolicy",
        "iam:PutRolePolicy"
      ],
      "Resource": [
        "arn:aws:iam::<aws_account_id>:role/PolyAI*",
        "arn:aws:iam::<aws_account_id>:policy/PolyAI*"
      ]
    },
    {
      "Sid": "LambdaPermissions",
      "Effect": "Allow",
      "Action": [
        "lambda:CreateFunction",
        "lambda:UpdateFunctionCode",
        "lambda:TagResource",
        "lambda:AddPermission",
        "lambda:GetFunction",
        "lambda:UpdateFunctionConfiguration",
        "lambda:DeleteFunction",
        "lambda:PutFunctionConcurrency",
        "lambda:ListTags"
      ],
      "Resource": "arn:aws:lambda:*:<aws_account_id>:function:PolyAI*"
    },
    {
      "Sid": "CloudWatchLogsPermissions",
      "Effect": "Allow",
      "Action": [
        "logs:TagLogGroup",
        "logs:DeleteRetentionPolicy",
        "logs:TagResource",
        "logs:PutRetentionPolicy",
        "logs:CreateLogGroup",
        "logs:DescribeLogGroups",
        "logs:DeleteLogGroup"
      ],
      "Resource": "arn:aws:logs:*:<aws_account_id>:log-group:/aws/lambda/PolyAIWriteContactAttributesToDDB*"
    },
    {
      "Sid": "S3ReadPermissions",
      "Effect": "Allow",
      "Action": "s3:Get*",
      "Resource": "*"
    }
  ]
}

Step 3: Create the CloudFormation Stack

  1. Go to AWS Console → CloudFormation
  2. Ensure you are in the same AWS region as your Amazon Connect instance
  3. Click Create stack → With new resources (standard)
  4. Select Upload a template file
  5. Upload the CloudFormation JSON file downloaded in Step 1
  6. Click Next

Step 4: Configure Stack Parameters

Required Parameters

  • Stack name A descriptive name to identify the PolyAI integration (no functional impact)
  • PolyAIPhoneNumbers Comma-separated list of phone numbers purchased in PolyAI Agent Studio Example:
    +11234567890,+19999999999,+440000000000
    
  • amazonConnectInstanceArn The ARN of your Amazon Connect instance
  • s3CodeBucket Select the bucket that matches your Amazon Connect region:
    arn:aws:s3:::polyai-amazon-connect-cloudformation-artifacts-eu-west-2
    arn:aws:s3:::polyai-amazon-connect-cloudformation-artifacts-us-east-1
    arn:aws:s3:::polyai-amazon-connect-cloudformation-artifacts-ap-northeast-2
    arn:aws:s3:::polyai-amazon-connect-cloudformation-artifacts-ap-southeast-2
    arn:aws:s3:::polyai-amazon-connect-cloudformation-artifacts-eu-central-1
    arn:aws:s3:::polyai-amazon-connect-cloudformation-artifacts-us-west-2
    
  • s3KeyPrefix
    template/v2/20250930-102558-addb90276bd7525c035aceff522df40e2d75a933/write_contact_attributes_to_ddb.zip
    
  • polyAIAssignedExternalId The project_id of your PolyAI Agent Studio project

Optional Parameters

You may leave these at their default values unless customization is required:
  • DDBRecordTTL
  • WriteContactAttributesToDDBLambdaMemorySize
  • WriteContactAttributesToDDBLambdaResConcurrency
  • WriteContactAttributesToDDBLambdaTimeout
  • contactAttributesDDBReadCapacity
  • contactAttributesDDBWriteCapacity
  • resourceSuffix
  • resourceTag

Step 5: Assign the IAM Role

When prompted, select the IAM role created in Step 2 to execute the CloudFormation stack. Proceed to create the stack.

Step 6: Share Integration Details with PolyAI

Once the CloudFormation stack completes successfully, provide the following details to PolyAI via the Agent Studio Project Page → Integrations page → Amazon Connect:
  • DynamoDB table ARN
  • IAM Role ARN (PolyAIRoleToReadAndUpdateContactAttributes)

Step 7: PolyAI Configuration

PolyAI will validate the provided values to ensure all resources are configured correctly. This validation typically takes around 30 seconds to complete. Once finished, your integration will be fully set up for the project. At this point, the PolyAI-side configuration is complete, and you can proceed to create the Amazon Connect flow by following the instructions to begin routing calls.

Support

If you encounter any issues during setup, please contact your PolyAI representative or PolyAI Support.