Skip to content
tgigsigniant edited this page Oct 30, 2019 · 7 revisions

The replication solution is deployed to AWS using CloudFormation. The CloudFormation template is constructed using cfn-include and grunt to minify our lambda function code and inject it into the template.

Building the Template

  1. Clone the repository:
    git clone https://github.com/Signiant/dynamodb-replication.git
    cd dynamodb-replication

  2. Install dependencies:
    npm install

  3. Run the build process:
    npm run build

The build process will output the final CloudFormation template to dist/replicator.cfn.json

Creating the Stack

To deploy the replication solution, navigate to CloudFormation on the AWS console and create a new stack using the final template. The CloudFormation stack must be created in same region as the tables you wish to replicate. When creating the CloudFormation stack, you will be prompted to enter values for the following parameters:

  • ReplicaRegion - The destination region for replication
  • ApiName - The name for the API Gateway API
  • ControllerTableName - The name for the DynamoDB controller table
  • PrefixTableName - The name for the DynamoDB prefix table
  • DelayThreshold - An alarm will be triggered if replication delay is greater than or equal to this amount of time (in minutes)
  • DelayNotifications - Should notifications be sent when a replication falls too far behind (if set to false, ignore the next two parameters)
  • DelayEndpointProtocol - The type of endpoint delay notifications should be sent to
  • DelayEndpoint - The endpoint delay notifications should be sent to

Once the parameters are complete, continue through the rest of the prompts to deploy the stack. Once the stack status is updated to CREATE_COMPLETE, you are ready to start replication!