aws-samples / amazon-bedrock-workshop

This is a workshop designed for Amazon Bedrock a foundational model service.
https://catalog.us-east-1.prod.workshops.aws/workshops/a4bdb007-5600-4368-81c5-ff5b4154f518/en-US/20-intro
MIT No Attribution
1.34k stars 576 forks source link

Invalid LocationConstraint error in lab 03_QuestionAnswering/knowledge-bases /0_create_ingest_documents_test_kb.ipynb #190

Open GAcharyaOS opened 6 months ago

GAcharyaOS commented 6 months ago

The jupyter notebook provided in the lab does not work for deployment in us-east-1 region. Remove the item in the bold from the below code in the notebook cell to create S3 bucket for knowledgebase :

Create S3 bucket for knowledge base data source

s3bucket = s3_client.create_bucket( Bucket=bucket_name, CreateBucketConfiguration={ 'LocationConstraint': region_name } )

GAcharyaOS commented 6 months ago

NOTE : Above suggested change only apply to deployment in us-east-1 region. For all other regions, existing code works fine.

Another option to make it for all the regions could be to set the region_name at the time of creating s3_client object. for e.g. s3_client = boto3.client('s3', region_name=region_name)

w601sxs commented 4 months ago

can you check @mani-aiml

w601sxs commented 3 months ago

can you check if our recent commits fix this @mani-aiml

ebaizel commented 3 weeks ago

I am also seeing this on another KB module.

There is a suggested resolution in this thread. https://github.com/aws/aws-sdk-js/issues/3647#issuecomment-1926614058