DocsAWS 101BlogServices

DynamoDB

Key-value + document store — tables, indexes, TTL, transactions, streams, PartiQL.

JSON-RPC (X-Amz-Target) multi-tenant 54 operations

Quick start

import boto3
ddb = boto3.client("dynamodb", endpoint_url="http://localhost:4566",
                   region_name="us-east-1",
                   aws_access_key_id="test", aws_secret_access_key="test")
ddb.create_table(TableName="t",
    KeySchema=[{"AttributeName":"pk","KeyType":"HASH"}],
    AttributeDefinitions=[{"AttributeName":"pk","AttributeType":"S"}],
    BillingMode="PAY_PER_REQUEST")
ddb.put_item(TableName="t", Item={"pk":{"S":"k1"},"data":{"S":"v1"}})

Supported operations

54 operations exposed by this service as of MiniStack 1.5.31. Extracted directly from the handler dispatch in the source module.

BatchExecuteStatement BatchGetItem BatchWriteItem CreateBackup CreateTable DeleteBackup DeleteItem DeleteResourcePolicy DeleteTable DescribeBackup DescribeContinuousBackups DescribeContributorInsights DescribeEndpoints DescribeExport DescribeImport DescribeKinesisStreamingDestination DescribeLimits DescribeStream DescribeTable DescribeTimeToLive DisableKinesisStreamingDestination EnableKinesisStreamingDestination ExecuteStatement ExecuteTransaction ExportTableToPointInTime GetItem GetRecords GetResourcePolicy GetShardIterator ImportTable ListBackups ListContributorInsights ListExports ListImports ListStreams ListTables ListTagsOfResource PutItem PutResourcePolicy Query RestoreTableFromBackup RestoreTableToPointInTime Scan SearchVectors TagResource TransactGetItems TransactWriteItems UntagResource UpdateContinuousBackups UpdateContributorInsights UpdateItem UpdateKinesisStreamingDestination UpdateTable UpdateTimeToLive

CloudFormation

The CloudFormation engine provisions these resource types via this service:

AWS::DynamoDB::GlobalTable AWS::DynamoDB::Table

See CloudFormation engine for intrinsic support and lifecycle details.

Known limitations

  • Streams produce records on every write and Lambda event-source mappings on a stream do fire, but a stream exposes a single synthetic shard (no shard splitting/merging).
  • Global tables (version 2019.11.21) work through UpdateTable ReplicaUpdates: a replica is a copy of the table in the other region, and writes replicate between them.

Source

  • ministack/services/dynamodb.py

Read the source to verify the ops list above — dispatch tables and handler functions are the ground truth.