Privileges for DynamoDB Sync
This article describes the account permissions required by BladePipe when DynamoDB is used as a source or target data source for data migration or synchronization.
As a Source
Full Migration
- Requires Scan / Query / GetItem / BatchGetItem permissions on DynamoDB tables, as well as ListTables / DescribeTable to discover tables. ListTables is required for the connection test when adding a data source in BladePipe. If it is missing, the connection test reports a
not authorized ... ListTableserror. Do not omit it.
Example:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DynamoDBTableReadAndList",
"Effect": "Allow",
"Action": [
"dynamodb:ListTables",
"dynamodb:DescribeTable",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:GetItem",
"dynamodb:BatchGetItem"
],
"Resource": "*"
}
]
}
Incremental Sync
- Requires reading DynamoDB Streams, including ListStreams / DescribeStream / GetShardIterator / GetRecords.
Example:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DynamoDBStreamReadAll",
"Effect": "Allow",
"Action": [
"dynamodb:ListStreams",
"dynamodb:DescribeStream",
"dynamodb:GetShardIterator",
"dynamodb:GetRecords"
],
"Resource": "*"
}
]
}
Minimum Permission Configuration (Recommended)
To restrict permissions to specific tables, use the following minimum permission policy split into Discovery / Table / Stream sections:
- Discovery section:
ListTablesandListStreamsare global list actions. They do not support resource-level authorization and must useResource: "*". - Table section: Required for full migration. Restrict the resource ARN to the specific table and its global secondary indexes. If the task does not involve full migration, you can remove the unused actions from
GetItem / BatchGetItem / Query / Scan. - Stream section: Required for incremental sync. The stream resource ARN must use the
table/<Table-Name>/stream/*format. Do not use only the table ARN, orDescribeStreamwill be denied.
Example (replace <Region>, <Account-ID>, and <Table-Name>):
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DynamoDbDiscovery",
"Effect": "Allow",
"Action": [
"dynamodb:ListTables",
"dynamodb:ListStreams"
],
"Resource": "*"
},
{
"Sid": "DynamoDbTableRead",
"Effect": "Allow",
"Action": [
"dynamodb:DescribeTable",
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:Query",
"dynamodb:Scan"
],
"Resource": [
"arn:aws:dynamodb:<Region>:<Account-ID>:table/<Table-Name>",
"arn:aws:dynamodb:<Region>:<Account-ID>:table/<Table-Name>/index/*"
]
},
{
"Sid": "DynamoDbStreamRead",
"Effect": "Allow",
"Action": [
"dynamodb:DescribeStream",
"dynamodb:GetShardIterator",
"dynamodb:GetRecords"
],
"Resource": "arn:aws:dynamodb:<Region>:<Account-ID>:table/<Table-Name>/stream/*"
}
]
}