Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.24/5 (3 votes)
I'm trying to build a semantic search engine using Amazon Kendra. I wrote the code on Sagemaker's Jupyter Notebook. I'm stuck at the following part:

Code:

response = kendra.query(
    QueryText = "retrieve blue colored shoes from the inventory data",
    IndexId = "xxxxxx"
)


Error:
EndpointConnectionError: Could not connect to the endpoint URL: "https://kendra.eu-north-1.amazonaws.com/"


What I have tried:

My S3 buckets in which I've stored the datasets used in the code have the 'AWS Region' as 'Asia Pacific (Mumbai) ap-south-1'. My Amazon Kendra index too has the same region. Then why is my error talking about some other region: eu-north-1?
Posted
Updated 11-Sep-23 0:40am
Comments
Richard MacCutchan 11-Sep-23 8:03am    
Since we cannot see any of your code we cannot guess why your URI is incorrect.

1 solution

I fixed the error my mentioning the region within the code:

kendra = boto3.client("kendra", region_name='us-east-1')    
index_id = "05d8defe-e2-a9e3-3534de"
query = "boots please"

response = kendra.query(
    QueryText = query1,
    IndexId = index_id
)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900