Closed cdelgadob closed 4 years ago
I have the same question, it would be great to be able to use this to copy from AWS to local.
You can copy Dynamodb table from local to AWS and vice versa using the correct config
For example I want to copy test_table
from AWS to local I would provide the following config you the copy()
function in destination config
const sourceAWSConfig = {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
region: 'us-east-1',
};
var destinationAWSConfig = {
accessKeyId: 'AKID',
secretAccessKey: 'SECRET',
endpoint: "http://localhost:8000", // use the local dynamodb url here
region: 'us-west-2'
}
copy({
source: {
tableName: 'test_table',
config: sourceAWSConfig
},
destination: {
config: destinationAWSConfig,
tableName: 'copy_test_table',
},
log: true,
create: true,
}, function (err, result) {
if (err) {
console.log(err);
}
console.log(result);
});
Also it supports coping from local db to AWS if you reversed the config in previous example
Is it possible to use a local dynamodb as a source or target?