aws-samples / bedrock-claude-chat

AWS-native chatbot using Bedrock + Claude (+Mistral)
MIT No Attribution
693 stars 237 forks source link

specify the region when accessing AWS resources #304

Closed GitSumito closed 1 month ago

GitSumito commented 1 month ago

Issue

Fix to explicitly specify the region when accessing DynamoDB resources. This ensures consistency with IAM role policies and eliminates AccessDeniedException.

Description of changes:

just add region_name

test result

The following commands must be executed as a prerequisite https://github.com/aws-samples/bedrock-claude-chat/blob/main/backend/README.md

test command

python tests/test_repositories/test_conversation.py

AsIs:

    raise error_class(parsed_response, operation_name)
botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the PutItem operation: Requested resource not found

----------------------------------------------------------------------
Ran 4 tests in 3.216s

FAILED (errors=4)

ToBe:

Ran 4 tests in 30.375s

OK
statefb commented 1 month ago

LGTM, Thank you for your contribution!