Connecting a bot to a Lambda

0

Fairly new to Lex bots and Lambda so please forgive my utter lack of understanding

I'm following this blog https://aws.amazon.com/blogs/contact-center/updating-your-addresses-with-amazon-connect-and-amazon-lex/ and built out a lex bot along with the lambda, but what isnt clear to me is how i connect the bot up to the lambda

I've managed to publish it and link up the bot alias to the lambda alias, i can see it gets called but the responses i get in the bot dont align with what they should be. eg: me: Update Address bot: Intent UpdateAddress is fulfilled me: 90210 (this flows through to the zipcode slot) bot: Intent UpdateAddress is fulfilled

Is this all because i used a v2 bot? and if so, what changes do i need to make to make it work?

2 Answers
0

If you're not being prompted for the slot value when you provide an utterance of 'Update Address', I suspect it's because you haven't marked the slot as 'Required for this intent' (under the slot configuration in the Lex UI). The 'Intent <intent-name> is fulfilled' message means that the bot has completed its processing for that intent.

To learn more about Lex v2 I'd suggest looking at the workshop at https://catalog.us-east-1.prod.workshops.aws/workshops/94f60d43-15b7-45f4-bbbc-17889ae64ea0/en-US

AWS
answered a year ago
profile picture
EXPERT
reviewed 17 days ago
  • Hi Luke, The slot is required but yeah the lambda is coded for a V1 bot so it doesn't know what to do. will keep digging

  • Ah, gotcha. The input & response formats are different between Lex v1 and v2, so the Lambda needs to be modified to handle the different formats.

    Lex v1: https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html Lex v2: https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html#lambda-input-format

  • thanks for the workshop, I think Ive got the bot interacting with the lambda now but when it should be reading out the balance i get "Invalid Bot Configuration: Access denied while invoking lambda function arn:aws:lambda:ap-southeast-2:XXXXXXXXXXXX:function:SDP-Goldie-Bot from arn:aws:lex:ap-southeast-2:XXXXXXXXXXXX:bot-alias/F5912H9GI0/TSTALIASID. Please check the policy on this function." - ive tried recreating the lambda and repointing it, along with a few attempts at adding policies to no avail. any thoughts?

0

To verify if it is a v1 versus v2 issue at the Lambda level, just create a v1 bot and test it out. As mentioned, Lambda written for v1 (which is what this blog post did) does not work for Lex v2.

I suggest you start with this workshop https://catalog.us-east-1.prod.workshops.aws/workshops/638d00f5-2248-488f-b7ca-903e8b966bf8/en-US that uses Lex v2 as an example with Amazon Connect

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions