aws-samples / aws-genai-llm-chatbot

A modular and comprehensive solution to deploy a Multi-LLM and Multi-RAG powered chatbot (Amazon Bedrock, Anthropic, HuggingFace, OpenAI, Meta, AI21, Cohere, Mistral) using AWS CDK on AWS
https://aws-samples.github.io/aws-genai-llm-chatbot/
MIT No Attribution
1.1k stars 332 forks source link

Small Naming Bug Related To Kendra Index if Prefix has length 10 or 14 #601

Open wolfman-numba1 opened 2 weeks ago

wolfman-numba1 commented 2 weeks ago

According to the getName Util function, the name for resources is created using the following:

${prefix}-${value}

Any Kendra Indexes will fail to create if a prefix provided by a customer is of length 14 or 10 (if CMKs are selected via the config).

If a prefix of length 10 is used then the output name will be

0123456789-cmk-genaichatbot-workspaces and then shortened by the getName function to be: 1234567891-cmk-genaichatbot-

(which ends in a hyphen and results in the following error for the Kendra Index: "Invalid request provided: 1 validation error detected: Value 'qld-titles-cmk-genaichatbot-' at 'indexName' failed to satisfy constraint: Member must satisfy regular expression pattern: ^a-zA-Z0-9* (Service: Kendra, Status Code: 400, Request ID: 53513ed9-21ba-42f3-a7c5-8cae39dfd6a0)"

Similar will happen for any prefixes provided by customers of length 14:

01234567890123-genaichatbot-workspaces and then shortened by the getName function to be: 01234567890123-genaichatbot- causing the same above error again.