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

S3 bucket creation for Regions other than us-east-1 #177

Closed bengruher closed 4 months ago

bengruher commented 7 months ago

In 07_Agents/insurance_claims_agent notebooks (and possibly others), we make a call to the S3 boto3 client to create a bucket. However, if we are running the notebook in a Region other than us-east-1, we will receive the following error: A client error (IllegalLocationConstraintException) occurred when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.

To fix this error, we must specify the desired Region in the API call. For example, in the with_kb/create_and_invoke_agent notebook, we would change the S3 bucket creation cell to: # Create S3 bucket for Open API schema s3bucket = s3_client.create_bucket( Bucket=bucket_name, CreateBucketConfiguration={'LocationConstraint': region} )

w601sxs commented 4 months ago

Closing this; please refer to the latest bedrock workshop update and reopen if still relevant