From 045268697b75e410e9b8a37f2cb87ee9fc42deb9 Mon Sep 17 00:00:00 2001 From: Austen Young Date: Wed, 15 Nov 2023 07:35:56 -0500 Subject: [PATCH] set only GSI ProvisionedThroughput Read and Write capacity units if they are anything but 0 --- src/helper.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helper.js b/src/helper.js index 44b57aa..c823db3 100644 --- a/src/helper.js +++ b/src/helper.js @@ -258,7 +258,12 @@ const createGlobalTable = async function createGlobalTable( IndexName: gsi.IndexName, KeySchema: gsi.KeySchema, Projection: gsi.Projection, - ProvisionedThroughput: gsi.ProvisionedThroughput + ...((gsi.ProvisionedThroughput.ReadCapacityUnits !== 0 || gsi.ProvisionedThroughput.WriteCapacityUnits !== 0) && { + ProvisionedThroughput: { + ReadCapacityUnits: gsi.ProvisionedThroughput.ReadCapacityUnits, + WriteCapacityUnits: gsi.ProvisionedThroughput.WriteCapacityUnits, + }, + }), }) }) }