Given a pair of DynamoDB Tables (provisioned using the eqx
tool; see below)
- Store table: holds application events
- read/written via
Equinox.DynamoStore
- appends are streamed via DynamoDB Streams with a 24h retention period
- read/written via
- Index table: holds an index for the table (internally the index is simply an
Equinox.DynamoStore
)- written by
Propulsion.DynamoStore.Indexer
- read by
Propulsion.DynamoStore.DynamoStoreSource
in Reactor/Projector applications
- written by
This project uses the AWS Cloud Development Kit (CDK) to reliably manage configuration/deployment of:
- The indexing logic in
Propulsion.DynamoStore.Indexer
(the NuGet package includes the published binaries internally) - Associated role and triggers that route from the Store Table's DynamoDB Stream to the Indexer Lambda and permissions to enable writing to the Index Table
(the project references
Propulsion.DynamoStore.Constructs.DynamoStoreIndexerLambda
, andPropulsion.DynamoStore.Indexer
) - Associated role and triggers that route from the Index Table's DynamoDB Stream to the Notifier Lambda, which publishes to an SNS Topic
(the project references
Propulsion.DynamoStore.Constructs.DynamoStoreNotifierLambda
, andPropulsion.DynamoStore.Notifier
)
-
A source DynamoDB Table, with DDB Streams configured
eqx initaws -r 10 -w 10 -s new dynamo -t equinox-test
-
An index DynamoDB Table (with Notifier support)
eqx initaws -r 5 -w 5 -s new dynamo -t equinox-test-index
OR (without Notifier support)
eqx initaws -r 5 -w 5 -s off dynamo -t equinox-test-index
-
AWS CDK Toolkit installed
npm install -g aws-cdk
See https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install for more details/context
# see below to look up DDB Streams ARNs for streamArn and indexStreamArn respectively
cdk deploy --all \
-c streamArn=arn:aws:dynamodb:us-east-1:111111111111:table/equinox-test/stream/2022-07-05T11:49:13.013 \
-c indexTableName=equinox-test-index \
-c indexStreamArn=arn:aws:dynamodb:us-east-1:111111111111:table/equinox-test-index/stream/2022-09-28T15:39:09.003
dotnet publish ../../propulsion/src/Propulsion.DynamoStore.Indexer &&
cdk deploy MainIndexer \
-c indexerCode=../../propulsion/src/Propulsion.DynamoStore.Indexer/bin/Debug/net6.0/linux-arm64/publish \
-c streamArn=arn:aws:dynamodb:us-east-1:111111111111:table/equinox-test/stream/2022-07-05T11:49:13.013 \
-c indexTableName=equinox-test-index
dotnet publish ../propulsion/src/Propulsion.DynamoStore.Notifier &&
cdk deploy MainNotifier \
-c notifierCode=../propulsion/src/Propulsion.DynamoStore.Notifier/bin/Debug/net6.0/linux-arm64/publish \
-c indexStreamArn=arn:aws:dynamodb:us-east-1:111111111111:table/equinox-test-index/stream/2022-09-28T15:39:09.003 \
-c notifyTopicArn=arn:aws:sns:us-east-1:111111111111:DynamoStore-not
# NOTE: notifyTopicArn is optional - default is to create a fresh SNS topic
eqx stats dynamo -t equinox-test
eqx stats dynamo -t equinox-test-index
dotnet build
check the CDK logic builds (no particular need to do this assynth
/deploy
triggers this implicitly)cdk ls
list all stacks in the appcdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk docs
open CDK documentation