Skip to content

Commit 68c991e

Browse files
committed
Fix: add BillingMode support (DynamoDb on-demand)
1 parent 1cc7d1b commit 68c991e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@ class ServerlessDynamodbLocal {
304304
if (migration.Tags) {
305305
delete migration.Tags;
306306
}
307+
if (migration.BillingMode) {
308+
delete migration.BillingMode;
309+
const defaultProvisioning = {
310+
ReadCapacityUnits: 5,
311+
WriteCapacityUnits: 5
312+
};
313+
migration.ProvisionedThroughput = defaultProvisioning;
314+
if (migration.GlobalSecondaryIndexes) {
315+
migration.GlobalSecondaryIndexes.forEach(gsi => {
316+
gsi.ProvisionedThroughput = defaultProvisioning;
317+
});
318+
}
319+
}
307320
dynamodb.raw.createTable(migration, (err) => {
308321
if (err) {
309322
if (err.name === 'ResourceInUseException') {

0 commit comments

Comments
 (0)