From 800d3206526e9b26b2a1d9515e05ede9db913f4b Mon Sep 17 00:00:00 2001 From: Mengjie Deng Date: Fri, 11 Jan 2019 09:40:48 +0100 Subject: [PATCH 01/12] support billing mode --- cli.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli.js b/cli.js index 634af83..537aa85 100755 --- a/cli.js +++ b/cli.js @@ -186,6 +186,16 @@ function filterTable(table) { delete table.LatestStreamArn; delete table.TableId; + // to support billing mode + if (table.BillingModeSummary) { + table.BillingMode = table.BillingModeSummary.BillingMode; + delete table.BillingModeSummary; + table.ProvisionedThroughput = { + ReadCapacityUnits: 100, + WriteCapacityUnits: 100 + }; + } + (table.LocalSecondaryIndexes || []).forEach(index => { delete index.IndexSizeBytes; delete index.ItemCount; From 8cd5c70de5c6b7f3321bb724545c85aabda9b908 Mon Sep 17 00:00:00 2001 From: Mengjie Deng Date: Fri, 11 Jan 2019 12:46:49 +0100 Subject: [PATCH 02/12] support billing mode --- cli.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli.js b/cli.js index 537aa85..3f8e93c 100755 --- a/cli.js +++ b/cli.js @@ -208,6 +208,10 @@ function filterTable(table) { delete index.ItemCount; delete index.IndexArn; delete index.ProvisionedThroughput.NumberOfDecreasesToday; + delete index.ProvisionedThroughput.LastIncreaseDateTime; + delete index.ProvisionedThroughput.LastDecreaseDateTime; + index.ProvisionedThroughput.ReadCapacityUnits = 100; + index.ProvisionedThroughput.WriteCapacityUnits = 100; }); } From 7c619ac10376184e2197873ac8d4daf5c84b4d43 Mon Sep 17 00:00:00 2001 From: Mengjie Deng Date: Mon, 14 Jan 2019 10:13:13 +0100 Subject: [PATCH 03/12] add write and read option for billing mode pay per request --- cli.js | 62 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/cli.js b/cli.js index 3f8e93c..89a6367 100755 --- a/cli.js +++ b/cli.js @@ -31,6 +31,9 @@ const cli = meow(` Options --region AWS region + --endpoint AWS DynamoDB endpoint + --writeCapacityUnits writeCapacityUnits when the BillingMode is PAY_PER_REQUEST + --readCapacityUnits readCapacityUnits when the billingMode is PAY_PER_REQUEST --file File name to export to or import from (defaults to table_name.dynamoschema and table_name.dynamodata) --table Table to export. When importing, this will override the TableName from the schema dump file --wait-for-active Wait for table to become active when importing schema @@ -75,13 +78,14 @@ bluebird.resolve(method.call(undefined, cli)) function listTablesCli(cli) { const region = cli.flags.region; + const endpoint = cli.flags.endpoint; - return listTables(region) + return listTables(region, endpoint) .then(tables => console.log(tables.join(' '))); } -function listTables(region) { - const dynamoDb = new AWS.DynamoDB({ region }); +function listTables(region, endpoint) { + const dynamoDb = new AWS.DynamoDB({ region, endpoint }); const params = {}; @@ -104,25 +108,27 @@ function listTables(region) { function exportSchemaCli(cli) { const tableName = cli.flags.table; + const endpoint = cli.flags.endpoint; if (!tableName) { console.error('--table is requred') cli.showHelp(); } - return exportSchema(tableName, cli.flags.file, cli.flags.region) + return exportSchema(tableName, cli.flags.file, cli.flags.region, endpoint) } function exportAllSchemaCli(cli) { const region = cli.flags.region; + const endpoint = cli.flags.endpoint; return bluebird.map(listTables(region), tableName => { console.error(`Exporting ${tableName}`); - return exportSchema(tableName, null, region); + return exportSchema(tableName, null, region, endpoint); }, { concurrency: 1 }); } -function exportSchema(tableName, file, region) { - const dynamoDb = new AWS.DynamoDB({ region }); +function exportSchema(tableName, file, region, endpoint) { + const dynamoDb = new AWS.DynamoDB({ region, endpoint }); return dynamoDb.describeTable({ TableName: tableName }).promise() .then(data => { @@ -137,14 +143,17 @@ function importSchemaCli(cli) { const tableName = cli.flags.table; const file = cli.flags.file; const region = cli.flags.region; + const endpoint = cli.flags.endpoint; const waitForActive = cli.flags.waitForActive; + const writeCapacityUnits = cli.flags.writeCapacityUnits || 10; + const readCapacityUnits = cli.flags.readCapacityUnits || 10; if (!file) { console.error('--file is requred') cli.showHelp(); } - const dynamoDb = new AWS.DynamoDB({ region }); + const dynamoDb = new AWS.DynamoDB({ region, endpoint }); const doWaitForActive = () => promisePoller({ taskFn: () => { @@ -162,7 +171,7 @@ function importSchemaCli(cli) { .then(json => { if (tableName) json.TableName = tableName; - filterTable(json); + filterTable(json, writeCapacityUnits, readCapacityUnits); return dynamoDb.createTable(json).promise() .then(() => { @@ -173,7 +182,7 @@ function importSchemaCli(cli) { }); } -function filterTable(table) { +function filterTable(table, writeCapacityUnits = 10, readCapacityUnits = 10) { delete table.TableStatus; delete table.CreationDateTime; delete table.ProvisionedThroughput.LastIncreaseDateTime; @@ -186,13 +195,12 @@ function filterTable(table) { delete table.LatestStreamArn; delete table.TableId; - // to support billing mode if (table.BillingModeSummary) { table.BillingMode = table.BillingModeSummary.BillingMode; delete table.BillingModeSummary; table.ProvisionedThroughput = { - ReadCapacityUnits: 100, - WriteCapacityUnits: 100 + ReadCapacityUnits: readCapacityUnits, + WriteCapacityUnits: writeCapacityUnits }; } @@ -210,8 +218,8 @@ function filterTable(table) { delete index.ProvisionedThroughput.NumberOfDecreasesToday; delete index.ProvisionedThroughput.LastIncreaseDateTime; delete index.ProvisionedThroughput.LastDecreaseDateTime; - index.ProvisionedThroughput.ReadCapacityUnits = 100; - index.ProvisionedThroughput.WriteCapacityUnits = 100; + index.ProvisionedThroughput.ReadCapacityUnits = readCapacityUnits; + index.ProvisionedThroughput.WriteCapacityUnits = writeCapacityUnits; }); } @@ -219,6 +227,7 @@ function importDataCli(cli) { const tableName = cli.flags.table; const file = cli.flags.file; const region = cli.flags.region; + const endpoint = cli.flags.endpoint; if (!tableName) { console.error('--table is requred') @@ -240,7 +249,7 @@ function importDataCli(cli) { } } - const dynamoDb = new AWS.DynamoDB({ region }); + const dynamoDb = new AWS.DynamoDB({ region, endpoint }); const readStream = fs.createReadStream(file); const parseStream = JSONStream.parse('*'); @@ -274,25 +283,26 @@ function importDataCli(cli) { function exportDataCli(cli) { const tableName = cli.flags.table; + const endpoint = cli.flags.endpoint; if (!tableName) { console.error('--table is requred') cli.showHelp(); } - return exportData(tableName, cli.flags.file, cli.flags.region); + return exportData(tableName, cli.flags.file, cli.flags.region, endpoint); } function exportAllDataCli(cli) { const region = cli.flags.region; return bluebird.map(listTables(region), tableName => { console.error(`Exporting ${tableName}`); - return exportData(tableName, null, region); + return exportData(tableName, null, region, endpoint); }, { concurrency: 1 }); } -function exportData(tableName, file, region) { - const dynamoDb = new AWS.DynamoDB({ region }); +function exportData(tableName, file, region, endpoint) { + const dynamoDb = new AWS.DynamoDB({ region, endpoint }); const file2 = file || sanitizeFilename(tableName + '.dynamodata'); const writeStream = fs.createWriteStream(file2); @@ -327,15 +337,17 @@ function exportData(tableName, file, region) { function exportAllCli(cli) { const region = cli.flags.region; + const endpoint = cli.flags.endpoint; return bluebird.map(listTables(region), tableName => { console.error(`Exporting ${tableName}`); - return exportSchema(tableName, null, region) - .then(() => exportData(tableName, null, region)) + return exportSchema(tableName, null, region, endpoint) + .then(() => exportData(tableName, null, region, endpoint)) }, { concurrency: 1 }); } function wipeDataCli(cli) { const tableName = cli.flags.table; + const endpoint = cli.flags.endpoint; if (!tableName) { console.error('--table is requred') @@ -353,11 +365,11 @@ function wipeDataCli(cli) { } } - return wipeData(tableName, cli.flags.region, throughput); + return wipeData(tableName, cli.flags.region, endpoint, throughput); } -function wipeData(tableName, region, throughput) { - const dynamoDb = new AWS.DynamoDB({ region }); +function wipeData(tableName, region, endpoint, throughput) { + const dynamoDb = new AWS.DynamoDB({ region, endpoint }); let n = 0; From 16c8fc69e2993cad6ed54d6ab4e9784405717184 Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Wed, 16 Jan 2019 20:58:34 +0100 Subject: [PATCH 04/12] Added the --billing-mode parameter, arranged the way it is used in the script together with the read and write capacity parameters. --- cli.js | 57 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/cli.js b/cli.js index 89a6367..83c7fea 100755 --- a/cli.js +++ b/cli.js @@ -32,8 +32,9 @@ const cli = meow(` Options --region AWS region --endpoint AWS DynamoDB endpoint - --writeCapacityUnits writeCapacityUnits when the BillingMode is PAY_PER_REQUEST - --readCapacityUnits readCapacityUnits when the billingMode is PAY_PER_REQUEST + --billing-mode To set the BillingMode property of the table when importing the data + --write-capacity To set the ProvisionedThroughput.WriteCapacityUnits property of the table when importing the schema + --read-capacity To set the ProvisionedThroughput.ReadCapacityUnits property of the table when importing the schema --file File name to export to or import from (defaults to table_name.dynamoschema and table_name.dynamodata) --table Table to export. When importing, this will override the TableName from the schema dump file --wait-for-active Wait for table to become active when importing schema @@ -44,6 +45,8 @@ const cli = meow(` Examples dynamodump export-schema --region=eu-west-1 --table=your-table --file=your-schema-dump dynamodump import-schema --region=eu-west-1 --file=your-schema-dump --table=your-table --wait-for-active + dynamodump import-schema --region=eu-west-1 --endpoint=localhost:8000 --billing-mode=PROVISIONED \ + --write-capacity=1 --read-capacity=1 --table=your-table --file=your-schema-dump dynamodump export-all-data --region=eu-west-1 dynamodump import-data --region=eu-west-1 --table=mikael-test --file=mikael-test.dynamodata dynamodump wipe-data --region=eu-west-1 --table=mikael-test --throughput=10 @@ -145,8 +148,9 @@ function importSchemaCli(cli) { const region = cli.flags.region; const endpoint = cli.flags.endpoint; const waitForActive = cli.flags.waitForActive; - const writeCapacityUnits = cli.flags.writeCapacityUnits || 10; - const readCapacityUnits = cli.flags.readCapacityUnits || 10; + const billingMode = cli.flags.billingMode; + const writeCapacityUnits = cli.flags.writeCapacity; + const readCapacityUnits = cli.flags.readCapacity; if (!file) { console.error('--file is requred') @@ -171,7 +175,7 @@ function importSchemaCli(cli) { .then(json => { if (tableName) json.TableName = tableName; - filterTable(json, writeCapacityUnits, readCapacityUnits); + filterTable(json, billingMode, writeCapacityUnits, readCapacityUnits); return dynamoDb.createTable(json).promise() .then(() => { @@ -182,7 +186,7 @@ function importSchemaCli(cli) { }); } -function filterTable(table, writeCapacityUnits = 10, readCapacityUnits = 10) { +function filterTable(table, forcedBillingMode, forcedWriteCapacityUnits, forcedReadCapacityUnits) { delete table.TableStatus; delete table.CreationDateTime; delete table.ProvisionedThroughput.LastIncreaseDateTime; @@ -195,13 +199,22 @@ function filterTable(table, writeCapacityUnits = 10, readCapacityUnits = 10) { delete table.LatestStreamArn; delete table.TableId; - if (table.BillingModeSummary) { + if (forcedBillingMode) { + table.BillingMode = forcedBillingMode; + } else if (table.BillingModeSummary) { table.BillingMode = table.BillingModeSummary.BillingMode; - delete table.BillingModeSummary; - table.ProvisionedThroughput = { - ReadCapacityUnits: readCapacityUnits, - WriteCapacityUnits: writeCapacityUnits - }; + } + delete table.BillingModeSummary; + + if (table.BillingMode !== 'PAY_PER_REQUEST') { + if (forcedReadCapacityUnits) { + table.ProvisionedThroughput.ReadCapacityUnits = forcedReadCapacityUnits; + } + if (forcedWriteCapacityUnits) { + table.ProvisionedThroughput.WriteCapacityUnits = forcedWriteCapacityUnits; + } + } else { + delete table.ProvisionedThroughput; } (table.LocalSecondaryIndexes || []).forEach(index => { @@ -215,11 +228,21 @@ function filterTable(table, writeCapacityUnits = 10, readCapacityUnits = 10) { delete index.IndexSizeBytes; delete index.ItemCount; delete index.IndexArn; - delete index.ProvisionedThroughput.NumberOfDecreasesToday; - delete index.ProvisionedThroughput.LastIncreaseDateTime; - delete index.ProvisionedThroughput.LastDecreaseDateTime; - index.ProvisionedThroughput.ReadCapacityUnits = readCapacityUnits; - index.ProvisionedThroughput.WriteCapacityUnits = writeCapacityUnits; + + if (table.BillingMode !== 'PAY_PER_REQUEST') { + delete index.ProvisionedThroughput.NumberOfDecreasesToday; + delete index.ProvisionedThroughput.LastIncreaseDateTime; + delete index.ProvisionedThroughput.LastDecreaseDateTime; + + if (forcedReadCapacityUnits) { + index.ProvisionedThroughput.ReadCapacityUnits = forcedReadCapacityUnits; + } + if (forcedWriteCapacityUnits) { + index.ProvisionedThroughput.WriteCapacityUnits = forcedWriteCapacityUnits; + } + } else { + delete index.ProvisionedThroughput; + } }); } From 979affd368c37b86760e862d8cdd36a5849d559e Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 12:44:02 +0100 Subject: [PATCH 05/12] Examples list fix --- cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli.js b/cli.js index 83c7fea..d55b2f8 100755 --- a/cli.js +++ b/cli.js @@ -45,7 +45,7 @@ const cli = meow(` Examples dynamodump export-schema --region=eu-west-1 --table=your-table --file=your-schema-dump dynamodump import-schema --region=eu-west-1 --file=your-schema-dump --table=your-table --wait-for-active - dynamodump import-schema --region=eu-west-1 --endpoint=localhost:8000 --billing-mode=PROVISIONED \ + dynamodump import-schema --region=eu-west-1 --endpoint=localhost:8000 --billing-mode=PROVISIONED \\ --write-capacity=1 --read-capacity=1 --table=your-table --file=your-schema-dump dynamodump export-all-data --region=eu-west-1 dynamodump import-data --region=eu-west-1 --table=mikael-test --file=mikael-test.dynamodata From 10e7342023f334ed63ba898c6fce9c7854e6510b Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 14:56:10 +0100 Subject: [PATCH 06/12] Added the --force parameter to pre-delete the table before importing the schema --- cli.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/cli.js b/cli.js index d55b2f8..2768bb7 100755 --- a/cli.js +++ b/cli.js @@ -151,6 +151,7 @@ function importSchemaCli(cli) { const billingMode = cli.flags.billingMode; const writeCapacityUnits = cli.flags.writeCapacity; const readCapacityUnits = cli.flags.readCapacity; + const force = cli.flags.force; if (!file) { console.error('--file is requred') @@ -170,8 +171,44 @@ function importSchemaCli(cli) { retries: 60 }); + const doWaitForDeleted = () => promisePoller({ + taskFn: () => { + return new Promise((resolve, reject) => { + dynamoDb.describeTable({ TableName: tableName }).promise() + .then(reject) + .catch(err => { + if (err.code === 'ResourceNotFoundException') { + resolve(); + } else { + reject(); + } + }); + }); + }, + interval: 1000, + retries: 600 + }); + fs.readFileAsync(file) .then(data => JSON.parse(data)) + .then(json => { + if (!force) { + return json; + } + + return new Promise((resolve, reject) => { + dynamoDb.deleteTable({ TableName: tableName || json.TableName }).promise() + .catch(err => { + if (err.code === 'ResourceNotFoundException') { + resolve(); + } else { + reject(); + } + }) + .then(doWaitForDeleted) + .then(resolve); + }); + }) .then(json => { if (tableName) json.TableName = tableName; From e8bbc02405c34cbcd7fb9a769098152fd3a2bfe2 Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 15:12:51 +0100 Subject: [PATCH 07/12] Added the --force parameter to pre-delete the table before importing the schema --- cli.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cli.js b/cli.js index 2768bb7..51b1005 100755 --- a/cli.js +++ b/cli.js @@ -37,6 +37,7 @@ const cli = meow(` --read-capacity To set the ProvisionedThroughput.ReadCapacityUnits property of the table when importing the schema --file File name to export to or import from (defaults to table_name.dynamoschema and table_name.dynamodata) --table Table to export. When importing, this will override the TableName from the schema dump file + --force Pre-deletes the table that we're exporting the schema into in case the table exists (import-schema) --wait-for-active Wait for table to become active when importing schema --profile utilize named profile from .aws/credentials file --throughput How many rows to delete in parallel (wipe-data) From 37a380e261821daff4b1672df7204b8427bfbef5 Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 15:19:32 +0100 Subject: [PATCH 08/12] Added the --force parameter to pre-delete the table before importing the schema --- cli.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli.js b/cli.js index 51b1005..f4d51d0 100755 --- a/cli.js +++ b/cli.js @@ -201,13 +201,13 @@ function importSchemaCli(cli) { dynamoDb.deleteTable({ TableName: tableName || json.TableName }).promise() .catch(err => { if (err.code === 'ResourceNotFoundException') { - resolve(); + resolve(json); } else { reject(); } }) .then(doWaitForDeleted) - .then(resolve); + .then(resolve(json)); }); }) .then(json => { From c5bf91c7e9247d32c4327edd40a500740cc7d50e Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 15:29:30 +0100 Subject: [PATCH 09/12] Added the --force parameter to pre-delete the table before importing the schema --- cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli.js b/cli.js index f4d51d0..ec45706 100755 --- a/cli.js +++ b/cli.js @@ -207,7 +207,7 @@ function importSchemaCli(cli) { } }) .then(doWaitForDeleted) - .then(resolve(json)); + .then(() => resolve(json)); }); }) .then(json => { From e2c9fba612127666589513b720dbaa5f9cf7dcfb Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 16:39:31 +0100 Subject: [PATCH 10/12] Added the --force parameter to pre-delete the table before importing the schema --- cli.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli.js b/cli.js index ec45706..7bf5fac 100755 --- a/cli.js +++ b/cli.js @@ -37,7 +37,7 @@ const cli = meow(` --read-capacity To set the ProvisionedThroughput.ReadCapacityUnits property of the table when importing the schema --file File name to export to or import from (defaults to table_name.dynamoschema and table_name.dynamodata) --table Table to export. When importing, this will override the TableName from the schema dump file - --force Pre-deletes the table that we're exporting the schema into in case the table exists (import-schema) + --force Pre-deletes the table that we're importing the schema into in case the table exists (import-schema) --wait-for-active Wait for table to become active when importing schema --profile utilize named profile from .aws/credentials file --throughput How many rows to delete in parallel (wipe-data) @@ -47,7 +47,7 @@ const cli = meow(` dynamodump export-schema --region=eu-west-1 --table=your-table --file=your-schema-dump dynamodump import-schema --region=eu-west-1 --file=your-schema-dump --table=your-table --wait-for-active dynamodump import-schema --region=eu-west-1 --endpoint=localhost:8000 --billing-mode=PROVISIONED \\ - --write-capacity=1 --read-capacity=1 --table=your-table --file=your-schema-dump + --force --write-capacity=10 --read-capacity=10 --table=your-table --file=your-schema-dump dynamodump export-all-data --region=eu-west-1 dynamodump import-data --region=eu-west-1 --table=mikael-test --file=mikael-test.dynamodata dynamodump wipe-data --region=eu-west-1 --table=mikael-test --throughput=10 From aae9956f95bf649a5266a6ed45562f2e00e16813 Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 16:42:40 +0100 Subject: [PATCH 11/12] Added the --force parameter to pre-delete the table before importing the schema --- cli.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli.js b/cli.js index 7bf5fac..75dfbdc 100755 --- a/cli.js +++ b/cli.js @@ -33,8 +33,8 @@ const cli = meow(` --region AWS region --endpoint AWS DynamoDB endpoint --billing-mode To set the BillingMode property of the table when importing the data - --write-capacity To set the ProvisionedThroughput.WriteCapacityUnits property of the table when importing the schema - --read-capacity To set the ProvisionedThroughput.ReadCapacityUnits property of the table when importing the schema + --write-capacity To set the ProvisionedThroughput.WriteCapacityUnits property of the table AND indices when importing the schema + --read-capacity To set the ProvisionedThroughput.ReadCapacityUnits property of the table AND indices when importing the schema --file File name to export to or import from (defaults to table_name.dynamoschema and table_name.dynamodata) --table Table to export. When importing, this will override the TableName from the schema dump file --force Pre-deletes the table that we're importing the schema into in case the table exists (import-schema) From fd2ca588037b9e897b31c4556c642eed02ab45c7 Mon Sep 17 00:00:00 2001 From: Anton Kazakov Date: Thu, 17 Jan 2019 16:44:48 +0100 Subject: [PATCH 12/12] Added the --force parameter to pre-delete the table before importing the schema --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0246f3d..782284e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dynamodump 🕋→💾 Node cli for exporting & importing schema and data from DynamoDB tables. I didn't find any other node tools for dumping table schema (structure, indexes etc), they all just dump data. - +Supports on-demand capacity tables. ## Install ``` @@ -19,6 +19,7 @@ dynamodump dynamodump export-schema --region=eu-west-1 --table=your-table --file=your-schema-dump dynamodump import-schema --region=eu-west-1 --file=your-schema-dump --table=your-table --wait-for-active dynamodump export-all-data --region=eu-west-1 +dynamodump import-schema --region=eu-west-1 --endpoint=localhost:8000 --billing-mode=PROVISIONED --force --write-capacity=10 --read-capacity=10 --table=your-table --file=your-schema-dump dynamodump import-data --region=eu-west-1 --table=mikael-test --file=mikael-test.dynamodata dynamodump wipe-data --throughput 5 --table your-table --region eu-west-1 AWS_PROFILE=customprofile dynamodump list-tables