Created
March 16, 2020 19:11
-
-
Save philschmid/e0a24eacd59c56bfc1e06e896d0e23fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var copy = require('copy-dynamodb-table').copy | |
| var globalAWSConfig = { // AWS Configuration object http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#constructor-property | |
| accessKeyId: 'AKID', | |
| secretAccessKey: 'SECRET', | |
| region: 'eu-west-1' | |
| } | |
| var sourceAWSConfig = { | |
| accessKeyId: 'AKID', | |
| secretAccessKey: 'SECRET', | |
| region: 'eu-west-1' | |
| } | |
| var destinationAWSConfig = { | |
| accessKeyId: 'AKID', | |
| secretAccessKey: 'SECRET', | |
| region: 'us-west-2' // support cross zone copying | |
| } | |
| copy({ | |
| config: globalAWSConfig, | |
| source: { | |
| tableName: 'source_table_name', // required | |
| config: sourceAWSConfig // optional , leave blank to use globalAWSConfig | |
| }, | |
| destination: { | |
| tableName: 'destination_table_name', // required | |
| config: destinationAWSConfig // optional , leave blank to use globalAWSConfig | |
| }, | |
| log: true,// default false | |
| create : true // create destination table if not exist | |
| }, | |
| function (err, result) { | |
| if (err) { | |
| console.log(err) | |
| } | |
| console.log(result) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment