Skip to content

Lex was unable to invoke the Bedrock foundation model on your behalf. Check that your role has permissions to allow Lex to invoke the appropriate Bedrock model and try your request again.

0

Hello, I am a beginner in AWS and want to interact with bedrock's knowledge base to Amazon Lex. I clicked "Use built-in intent">AMAZON.QnAIntent>Knowledge base for Amazon bedrock>copied Amazon Bedrock Id>Save Intent>Build>Test

Then it shown "Invalid Bot Configuration: Lex was unable to invoke the Bedrock foundation model on your behalf. Check that your role has permissions to allow Lex to invoke the appropriate Bedrock model and try your request again." with red colour Enter image description here

I have checked the role that I created Amazon Lex Bot, there is not "Add" button to add Amazon Bedrock policies... Enter image description here

so are there any solution? Really thank you very much..

3 Answers
0

Is the knowledgeBase present in the same region as the Lex Bot? Lex does not allow cross region resource calls. Make sure to have the Bedrock Knowledge Base in the same region as the Lex bot.

AWS
answered 2 years ago
0

Hi,

The message indicates a permission error in the execution role of Lex not properly defined to get access to Bedtock.

So, did you define an execution role for Lex ? (linked to the IAM policy statements that you show above)

Have a read at this post which does something very similar: https://aws.plainenglish.io/unleashing-the-power-of-conversational-ai-a-seamless-guide-to-creating-an-amazon-lex-chatbot-with-68f2e854377c

Best,

Didier

EXPERT
answered 2 years ago
  • Excuse me, how to "define an execution role for Lex"? I thought that the corresponding role had already been created when the bot was created, and the Gen AI Intent when creating was already "define an execution role for Lex"

0

This is months late, but I encountered the same issue and struggled for a bit, and wanted to leave an answer for those coming later.

When you select the AI model for the intent, the dropdown of models is of models that work with Lex, not necessarily ones that you have requested/gotten access to in Bedrock. In my case I already had requested access in Bedrock to Claude 3.5 Haiku as well as several other versions of Claude. In Lex, I selected to use Claude 3.5 Sonnet, thinking I already had access to it.

I checked the Lex roles in IAM and found that it wasn't possible to modify them, so was confused, until I realized the confusion in model names. As soon as I went to Bedrock and requested access to the correct model, the error message went away.

AWS
answered 10 months 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.