amazon-archives/awsmobile-cli

[Question] How to add DynamoDB LSI ?

ronald8192 opened this issue · 1 comments

For example, I create a DynamoDB table by awsmobile-cli like this:
Hash key: OrderId (Number)
Range key: Priority (Number)
...

There is no LSI option when creating the table.
If I add index and select the same hash key, it will create a GSI.

$ awsmobile database configure
? Select from one of the choices below. Edit table from the project
? Select table to be edited my-table
? Select from one of the choices below. Add indexes
? Index name my-index-name
? Select partition key OrderId
? Select sort key CreatedAt
? Add index Yes

I also notice that I cannot select multiple range key or create index as LSI even on AWS console.

Is this a limitation of MobileHub?
Any way to create LSI for DynamoDB table for MobileHub project?

Hi @ronald8192, thanks for your feedback!

Currently awsmobile-cli can only create GSI, I will add this as a feature request