Skip to content

Commit 7ade485

Browse files
author
Imhoertha Ojior
committed
Update to use the default region instead of not setting a region.
1 parent 65b8881 commit 7ade485

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

workshops/relational-migration/chalicelib/dynamodb_calls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
serializer = boto3.dynamodb.types.TypeSerializer()
1414

1515
return_limit = 20
16+
region = os.getenv('AWS_DEFAULT_REGION','us-west-2')
1617

17-
ddb = boto3.client('dynamodb')
18-
ddbr = boto3.resource('dynamodb')
18+
ddb = boto3.client('dynamodb', region_name=region)
19+
ddbr = boto3.resource('dynamodb', region_name=region)
1920
# resource vs client: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/programming-with-python.html#programming-with-python-client-resource
2021

2122
serializer = TypeSerializer()

0 commit comments

Comments
 (0)