Amazon Lex and Cloudformation Compatibility Problems

0

Hello,

Since the newest Lex v2 update of August 17th, a lot was added in the Lex console v2 regarding conditional flows and prompting. I'm using a Cloudformation template file to create the Lex bot ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lex-bot.html )

I have 2 questions for the AWS folks:

  1. When do we expect to have the latest change from the Lex V2 to the Cloudformation template?
  2. When creating a new Cloudformation stack with the exact same template I had before August 17th, is it normal my new Lex bot doesn't work as it used to (Lambda function is no longer triggered even with the DialogCodeHook setting enabled)? I'm experiencing ground breaking behaviors with the newest update. See below for the new problems I am experiencing, with the exact same template I had before.

Problems (That I can see for the moment, as mentioned, it is groundbreaking and I cannot use the newly created bot with the same template)

Intent with Slots: Intents with slots wasn't required to have the PromptSpecification setting ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lex-bot-slotvalueelicitationsetting.html ). The reason I don't set it is that I need this prompt to be dynamic. It was working before, now, it still works for the import, but I'm getting the following error in the testing console of Lex: "The maxRetries value is not in the specified inclusive range of 0 to 5. Check the maxAttempts parameter and try your request again".

Lambda function not called: I'm not sure if this has anything to do with the new Initial response feature which can also call a Lambda function, but that is still to be defined in the Cloudformation template documentation. I'm not exactly sure what I did to make it work at some point, but I re-selected the same Lambda function over and over, saved and rebuilt the bot. Re-created a new IAM role, saved and rebuilt the bot. Repeated the same steps a few times and it started calling back my Lambda function again...

Thanks,

  • Hi, I am stuck in the same step: comunicate lex with lambda function with cloudformation template, Do you know wich element could remove the " Initial response feature" I guess that feacture cast the lambda before the user fill all the fields

    BTW Do you revied the cloudformation template give permisions to lambda function to enable invoke since lex?

John
asked 2 years ago786 views
2 Answers
1

Hello Don,

  1. Intent with Slots: Thanks a lot for looking into it. It can be an acceptable temporary fix. I haven't tried it yet if it works. We might play the waiting game until a fix comes along instead of adding this temporary fix to all of our intents.
  2. Lambda function not called: See files attached at the bottom of the message. I added the basic flower bot CFN. I added the intent TestIntent, which you can trigger with the utterance "test". I also attached a basic lambda function. It returns directly the closing message "Hi this is lambda speaking!". Once both are imported and you try to test with the Lex test console, it should call the lambda function, but returns fails instead (inspect the response, the state will be "Failed"). I'm not sure if it is a bug or if I am doing something wrong. When you will upload the CFN, set the function name parameter to the name of you Lambda function you will use.
  3. When do we expect to have the latest change from the Lex V2 to the Cloudformation template?: Thanks for the update.

(I didn't know how to attach files except to provide external links)

Basic Lex CFN: https://pastebin.com/t2aGUJBR

Basic Lambda Fct: https://pastebin.com/h2NnM8ct

One last "bug" I found is regarding the invocation label for the Invoke Dialog code hook (all of this inside the Lex Console only, not related to CFN), it seems that if there is a space in the label (or any other invalid chars), you can "save" the configuration, but it is stuck on the configuration pop up window. Instead of providing an error message around the Invocation label box, it just leaves you hanging with your malformed configuration, without any notice of what is wrong. It might be something to think about to be in line with UI best practices.

Thanks a lot for your help,

John
answered 2 years ago
  • Thanks John. We are looking into this from our end. Will get back to you as soon as we have any updates from our end.

0

Hi John

Thanks for bringing this to our attention.

  1. Intent with Slots: I verified the behavior you are correct with your findings here. We will prioritize this issue and fix this. Meanwhile can you work around this issue by specifying a dummy default message in the prompt? Let us know if this workaround is acceptable for you or if you have any concerns.
  2. Lambda function not called:- We could not reproduce this from our local testing. Will you be able to share a mock cfn template that you are using and we would be able to check it out.
  3. When do we expect to have the latest change from the Lex V2 to the Cloudformation template? - We have this in our queue. Cfn import via the zip file works as of now but inline Cfn templates do not support the new constructs yet.
AWS
Don
answered 2 years ago
  • I have also experienced the same issue with Lambda function invocation. Basically, reselection in the console starts calling the function.

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