I’m recently working on creating a bot with Amazon Lex. Reading the aws tutorials, I saw that they were outdated. This wasn’t a problem till I needed to hook a aws lambda function to my intent fulfillment. I discovered that I need to hook the lambda function to a bot alias (witch I created, but have not discovered how to hook the function) to be able to test the bot. I’m stuck on this problem. I would appreciate if someone that has already built a bot could explain me how to hook the lambda function to the bot intent.
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
I am going to assume that you’re working with version 2 of AWS Lex. A lot of people are experiencing the issue of associating a Lambda function with a Lex bot.
AWS have chosen a pretty weird way to configure this.
Please take a look at this answer that I had previously written on how to link a Lambda function to your Lex bot: https://stackoverflow.com/a/73621837/8880593
{
action: "lambda:InvokeFunction",
principal: new iam.AnyPrincipal(),
}
Add this permission to your lambda
If it works, you can limit your principal later on