Skip to main content

Creating and Setting Up Amazon Connect Contact Center

  1. To create your contact center:
    1. In Salesforce Setup, go to Identity, Identity Provider, and then Enable Identity Provider. You can select any certificate; you may need to go to Certificates and create a self-signed certificate first.
    2. Go to Feature Settings, Service, Voice, Partner Telephony Contact Centers, and then choose New on the upper right. Select Amazon Connect (should be the only option) and choose Next.
    3. Verify Create an Amazon Connect instance is selected. Enter a unique name in the Display Name field. IMPORTANT: If this process fails for some reason, you’ll need to enter a unique name for the Display Name every time you try again; the process will fail immediately if your Display Name/API Name match a value you already tried.
    4. For Region, select the AWS Region you want to use for your new Amazon Connect instance.
    5. For IAM Role ARN, paste the ARN of the ProvisioningRole you just created. Choose Next.
    6. Select your users on the Select an administrator page (SCCAC Administrator and SCCAC Agent) and choose Done. The process of creating the contact center will take 5-10 minutes and if all goes well, you’ll see new stacks being created in your AWS account (first in IAD for the central stacks, then your instance will be created, then instance-specific stacks will be deployed in the same region you selected for your Amazon Connect instance). You’ll receive an email when the process is complete.
  2. To prepare your contact center and Salesforce org:
    1. In Salesforce Setup, add your user to the connected app Salesforce has created for your Connect instance for SAML login
      1. Go to Apps, App Manager. You should see a connected app with a name {ContactCenterName} Connected App with the display name you chose for your new contact center. Choose the dropdown button in the rightmost column for this app and select Manage. Note that there will be a connected app below this one called {ContactCenterName} Connected App for RestAPI OAuth — ignore that one
      2. In the Profiles section, choose Manage Profiles. Select System Administrator and Standard User, any profile you are using for contact center and choose Save.

      Note: In newer orgs, Salesforce creates this app as an External Client App named {ContactCenterName} External Client App instead of a Connected App. In that case:

      1. Go to Setup > External Client Apps > External Client App Manager and open {ContactCenterName} External Client App.
      2. On the Policies tab, choose Edit. Under App Policies, add System Administrator, Standard User, and any profile you use for your contact center to Selected Profiles. Add the SCC Administrator and SCC Agent permission sets to Selected Permission Sets. Choose Save.
      3. If the Edit button is not available (the app is managed by Service Cloud Voice), grant access with Anonymous Apex instead. In the Developer Console, choose Debug > Open Execute Anonymous Window, paste the following script, update PROFILES and PERMISSION_SETS if needed, and choose Execute:
        // Profiles and permission sets to grant access to. Add any others you use for your contact center.
        Set<String> PROFILES = new Set<String>{'System Administrator', 'Standard User'};
        Set<String> PERMISSION_SETS = new Set<String>{'SCC_Administrator', 'SCC_Agent'};

        // Access is granted through permission sets; each profile has its own implicit permission set.
        Map<Id, String> targets = new Map<Id, String>();
        for (PermissionSet p : [SELECT Id, Name, Profile.Name, IsOwnedByProfile FROM PermissionSet
        WHERE (IsOwnedByProfile = true AND Profile.Name IN :PROFILES)
        OR Name IN :PERMISSION_SETS]) {
        targets.put(p.Id, p.IsOwnedByProfile ? 'profile ' + p.Profile.Name : 'permission set ' + p.Name);
        }
        if (targets.isEmpty()) { System.debug('STOP: none of those profiles or permission sets exist.'); return; }

        // Find each contact center's External Client App by name.
        Map<String, ExternalClientApplication> byName = new Map<String, ExternalClientApplication>();
        for (ExternalClientApplication e : [SELECT Id, DeveloperName, MasterLabel FROM ExternalClientApplication]) {
        byName.put(e.DeveloperName, e);
        }
        Map<Id, String> apps = new Map<Id, String>();
        for (CallCenter cc : [SELECT Name, InternalName FROM CallCenter]) {
        ExternalClientApplication app = byName.get(cc.InternalName + '_External_Client_App');
        if (app == null) app = byName.get(cc.Name + '_External_Client_App');
        if (app == null) System.debug('WARN: no External Client App found for contact center ' + cc.Name);
        else apps.put(app.Id, app.MasterLabel);
        }
        if (apps.isEmpty()) { System.debug('STOP: no External Client App matched, nothing was granted.'); return; }

        // Grant whatever is missing.
        Set<String> granted = new Set<String>();
        for (SetupEntityAccess s : [SELECT ParentId, SetupEntityId FROM SetupEntityAccess
        WHERE SetupEntityId IN :apps.keySet() AND ParentId IN :targets.keySet()]) {
        granted.add(String.valueOf(s.SetupEntityId).left(15) + '|' + s.ParentId);
        }
        List<SetupEntityAccess> toInsert = new List<SetupEntityAccess>();
        for (Id appId : apps.keySet()) {
        for (Id parentId : targets.keySet()) {
        if (!granted.contains(String.valueOf(appId).left(15) + '|' + parentId)) {
        toInsert.add(new SetupEntityAccess(ParentId = parentId, SetupEntityId = appId));
        System.debug('Granting ' + targets.get(parentId) + ' on ' + apps.get(appId));
        }
        }
        }
        insert toInsert;
        System.debug('DONE: ' + toInsert.size() + ' granted, ' + granted.size() + ' already in place.');
        Open the execution log, select Debug Only, and confirm the script printed DONE. Then refresh the app's Policies tab to confirm the profiles and permission sets now appear as selected.
    2. Go to the Amazon Connect console in AWS and find your newly-created Amazon Connect instance.
    3. Choose Flows in the left navigation menu. Scroll to Flow logs, and select Enable flow logs. This setting helps you debug flow failures.