Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a local secondary index in AWS DynamoDB?

i am trying to create a local secondary index via the management console. After selecting the desired table in DynamoDB, I choose the "index" tab and click "Create Index". Then I am prompted with the following UI. I cannot state, if the index should be local or global. AWS does not automatically check, wheter the index partition key equals the table partition key. Even when it is the same partition key, AWS specifies the Index as "GSI" instead of "LSI". I can configure a local secondary index via the cli correctly - this works perfectly fine.

I was just wondering, can you actually do this right in the management console? aws UI for index Creation

like image 589
anderwald Avatar asked Oct 20 '25 10:10

anderwald


1 Answers

You cannot create on an existing DynamoDB table, from the AWS documentation:

To create one or more local secondary indexes on a table, use the LocalSecondaryIndexes parameter of the CreateTable operation. Local secondary indexes on a table are created when the table is created. When you delete a table, any local secondary indexes on that table are also deleted.

You would need to either use a global secondary index, or migrate to a new table that you create the LSI at create time.

like image 186
Chris Williams Avatar answered Oct 22 '25 03:10

Chris Williams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!