Creating multiple GSIs by updateTable – DynamoDB

Question:

I’m uisng updateTable of DynmaoDB and based on the documentation, if we want to create multiple Global Secondary Indexes (GSIs) we need to have multiple objects in “GlobalSecondaryIndexUpdates” field, so I’m passing the following params, but it does not update the GSIs; however if I’m just creating one GSI (passing one object in “GlobalSecondaryIndexUpdates” field, it works); here is the params I’m passing for creating multiple GSIs:

Am I passing the params in a wrong format?

Answer:

From the DynamoDB documentation:

You can only create or delete one global secondary index per
UpdateTable operation. However, if you run multiple UpdateTable
operations simultaneously, you can create multiple indexes at a time.
You can run up to five of these UpdateTable operations on a table at
once, and each operation can create exactly one index.

Leave a Reply