Skip to content

Commit f6dbc6b

Browse files
authored
Merge pull request #190 from jslowack/v1
Added support for BillingMode (dynamodb on-demand)
2 parents 9ce9062 + a0bc732 commit f6dbc6b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,20 @@ class ServerlessDynamodbLocal {
314314
if (migration.Tags) {
315315
delete migration.Tags;
316316
}
317+
if (migration.BillingMode === "PAY_PER_REQUEST") {
318+
delete migration.BillingMode;
319+
320+
const defaultProvisioning = {
321+
ReadCapacityUnits: 5,
322+
WriteCapacityUnits: 5
323+
};
324+
migration.ProvisionedThroughput = defaultProvisioning;
325+
if (migration.GlobalSecondaryIndexes) {
326+
migration.GlobalSecondaryIndexes.forEach((gsi) => {
327+
gsi.ProvisionedThroughput = defaultProvisioning;
328+
});
329+
}
330+
}
317331
dynamodb.raw.createTable(migration, (err) => {
318332
if (err) {
319333
if (err.name === 'ResourceInUseException') {

0 commit comments

Comments
 (0)