amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

[Question] How to add DynamoDB LSI ? #177

Open ronald8192 opened 6 years ago

ronald8192 commented 6 years ago

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?

elorzafe commented 6 years ago

Hi @ronald8192, thanks for your feedback!

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