Skip to main content

DynamoDB Setup Guide

Prerequisites

Setting up DynamoDB takes three tasks in AWS, each covered below:

  • Create IAM Policy.
  • Create IAM Role and attach policy to it.
  • Turn on streams for your DynamoDB tables

Setup Guide

1. Create IAM Policy

  • Go to the AWS Management Console.
  • Open the IAM console.
  • In the navigation pane, choose Policies.
  • Choose Create policy.
  • Choose the JSON tab.
  • Enter the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:DescribeStream",
"dynamodb:DescribeTable",
"dynamodb:GetRecords",
"dynamodb:GetShardIterator",
"dynamodb:ListTables",
"dynamodb:Scan"
],
"Resource": "*"
}
]
}
IMPORTANT: Tables encrypted with a customer-managed KMS key need extra permissions. If any of your tables use one, also add these KMS actions to the policy's Action list:
"kms:Decrypt"
"kms:Encrypt"
"kms:GenerateDataKey"
"kms:ReEncryptTo"
"kms:GenerateDataKeyWithoutPlaintext"
"kms:DescribeKey"
"kms:ReEncryptFrom"
  • Choose Review policy.
  • Give the policy a Name, for example DynamoDB-Matia-Access.
  • (Optional) Add a Description that explains what the policy is for.
  • Choose Create policy.

2. Create IAM Role

  • Go to the AWS Management Console.
  • Open the IAM console.
  • In the navigation pane, choose Roles.
  • Choose Create role.
  • Choose Another AWS account.
  • Enter the following account ID: 035563399062.
  • Select the Require external ID check box.
  • Enter the External ID provided by the connector.
  • Click Next: Permissions.
  • Search for your new policy (for example, DynamoDB-Matia-Access) in the Filter policies box and select it.
  • Click Next: Tags.
  • Click Next: Review.
  • Give the role a Name, for example Matia-DynamoDB-Role.
  • (Optional) Add a Description that explains what the role is for.
  • Click Create role.

3. Turn on streams for your DynamoDB tables

  1. In the AWS console, open the DynamoDB service, click Tables, and pick a table you want to sync.
  2. Open the Exports and streams tab.
  3. Find DynamoDB stream details on that tab and click its Turn on button.
  4. Choose New and old images, so each stream record captures the item as it was before and after the change.
  5. Click Turn on stream.
  6. Do the same for every other table you want Matia to sync.