- Newest
- Most votes
- Most comments
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.
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
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"
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.
Relevant content
- AWS OFFICIALUpdated 8 months ago

They both are in the same region