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:
- Open the AWS Lambda console.
- In the navigation pane, choose Applications.
- Choose Create application.
- Choose the Serverless application tab.
- 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.
- 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:
- Download the InteractiveMessageBotV2.zip file. To download, see InteractiveMessageBotV2 from GitHub.
- Open the Amazon Lex console.
- Choose Action, and then choose Import.
- In the Bot name field, enter InteractiveMessageBot.
- Choose Browse file, select InteractiveMessageBotV2, and then choose Open.
- For IAM permissions, choose Create a role with basic Amazon Lex permissions or Use an existing role.
- For Children's Online Privacy Protection Act (COPPA), choose Yes or No.
- Choose Import.
- In the navigation pane, choose Bots.
- Select the bot that you want to attach a Lambda function to.
- In the navigation pane, under Deployment, choose Aliases.
- Select the alias that you want to attach a Lambda function to.
- In the Languages section, choose the language that you want the alias to use.
- In the Source menu, select the name of your Lambda function.
- 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:
- Open the Amazon Lex console.
- In the navigation pane, choose Bots.
- Select the bot that you created in the previous section.
- In the navigation pane, choose Intents.
- Choose Build.
- After the build is complete, choose Test Chatbot.
- In the Chat with your bot chat box, enter Help.
- Choose Save, and then choose Publish.
Configure your Lambda function and Amazon Lex V2 in Amazon Connect
Complete the following steps:
- Open the Amazon Connect console.
- Select your Amazon Connect instance alias.
- In the navigation pane, choose Flows.
- In the Amazon Lex section, enter a name for your bot. Then, choose +Add Amazon Lex Bot and your Lambda function.
- Log in to your Amazon Connect instance.
Note: You must assign the user a security profile that includes edit permissions for flows.
- In the navigation menu, choose Routing, Contact flows, and then choose Import.
- Upload the InteractiveMessaging Flow.
- Confirm that the Get customer input block is the same Amazon Lex bot.
- In the Amazon Connect dashboard, choose Test Chat, and then choose Test Settings.
- 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:
- Open the CloudWatch console.
- Choose Logs, and then choose Log groups.
- Select the log group for your instance.
- Choose Search log group.
- 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