Skip to content

How do I configure my Lambda function and Amazon Lex V2 in Amazon Connect, and then check for list picker errors?

4 minute read
0

I want to configure my Lambda function and Amazon Lex V2 in Amazon Connect, and then check for list picker errors.

Resolution

Create your Lambda function

Complete the following steps:

  1. Open the AWS Lambda console.
  2. In the navigation pane, choose Applications.
  3. Choose Create application.
  4. Choose the Serverless application tab.
  5. In the Public applications search bar, enter amazon-connect-interactive-messages-example-lex-v2. Then, select the amazon-connect-interactive-messages-example-lex-v2 option.
  6. On the Review, configure, and deploy page, confirm the Application details, and then choose Deploy.

Create an Amazon Lex V2 chatbot and connect to your Lambda function

Note: After September 2025, AWS will no longer support Amazon Lex V1. It's a best practice to use Amazon Lex V2.

To create an Amazon Lex V2 chatbot and connect to your Lambda function, complete the following steps:

  1. Download the InteractiveMessageBotV2.zip file. To download, see InteractiveMessageBotV2 from GitHub.
  2. Open the Amazon Lex console.
  3. Choose Action, and then choose Import.
  4. In the Bot name field, enter InteractiveMessageBot.
  5. Choose Browse file, select InteractiveMessageBotV2, and then choose Open.
  6. For IAM permissions, choose Create a role with basic Amazon Lex permissions or Use an existing role.
  7. For Children's Online Privacy Protection Act (COPPA), choose Yes or No.
  8. Choose Import.
  9. In the navigation pane, choose Bots.
  10. Select the bot that you want to attach a Lambda function to.
  11. In the navigation pane, under Deployment, choose Aliases.
  12. Select the alias that you want to attach a Lambda function to.
  13. In the Languages section, choose the language that you want the alias to use.
  14. In the Source menu, select the name of your Lambda function.
  15. In the Lambda function version or alias menu, choose the version or alias of the Lambda function that you want to use. Then, choose Save.
    Note: Amazon Lex uses the same Lambda function for all intents in a language that the bot supports.

Build and test the chatbot locally

Complete the following steps:

  1. Open the Amazon Lex console.
  2. In the navigation pane, choose Bots.
  3. Select the bot that you created in the previous section.
  4. In the navigation pane, choose Intents.
  5. Choose Build.
  6. After the build is complete, choose Test Chatbot.
  7. In the Chat with your bot chat box, enter Help.
  8. Choose Save, and then choose Publish.

Configure your Lambda function and Amazon Lex V2 in Amazon Connect

Complete the following steps:

  1. Open the Amazon Connect console.
  2. Select your Amazon Connect instance alias.
  3. In the navigation pane, choose Flows.
  4. In the Amazon Lex section, enter a name for your bot. Then, choose +Add Amazon Lex Bot and your Lambda function.
  5. Log in to your Amazon Connect instance.
    Note: You must assign the user a security profile that includes edit permissions for flows.
  6. In the navigation menu, choose Routing, Contact flows, and then choose Import.
  7. Upload the InteractiveMessaging Flow.
  8. Confirm that the Get customer input block is the same Amazon Lex bot.
  9. In the Amazon Connect dashboard, choose Test Chat, and then choose Test Settings.
  10. Select the contact flow that you want to test. For more information, see Test voice, chat, and task experiences in Amazon Connect.

Review list picker errors

Open the Amazon Connect console. Select your Amazon Connect instance, and then make sure that you activate Set logging behavior.

To check the Amazon CloudWatch logs for errors, complete the following steps:

  1. Open the CloudWatch console.
  2. Choose Logs, and then choose Log groups.
  3. Select the log group for your instance.
  4. Choose Search log group.
  5. In the search box, enter the string that you want to search for, for example, all or a portion of the contact ID. Then, CloudWatch returns results.
    Note: You can open each event to review what happened and look for any errors.

Related information

Add Amazon Lex interactive messages for customers in chat

Easily set up interactive messages for your Amazon Connect chatbot

1 Comment

Just minor addition for the section: Configure your Lambda function and Amazon Lex in Amazon Connect

4. Choose Flows and then select Import. Then upload the InteractiveMessaging Flow.

You would have to do this step in your Amazon Connect admin page (which is different than the Connect console page) after creating a new flow.

replied 6 months ago