1.2. Accessing DynamoDB TablesΒΆ
Once data models are defined, they can be used to interact with DynamoDB
tables. This is via the awstin.dynamodb.DynamoDB
class, which connects
to DynamoDB either via the AWS_REGION
(in production) or the
TEST_DYNAMODB_ENDPOINT
(in integration tests) environment variable. Tables
are accessed from the awstin.dynamodb.DynamoDB
instance via indexing
by awstin.dynamodb.DynamoModel
subclasses.
from awstin.dynamodb import DynamoDB
dynamodb = DynamoDB()
table = dynamodb[Movie]