How to add primary sort key to an already existing table in AWS dynamo db?

Viewed 15574

I have a pre-existing dynamo db table to which i want to add a primary sort key. All the items in the table contain the key which i want to delegate as the primary sort key.

1 Answers

DynamoDB doesn't allow to add Sort key for the existing table.

It allows the following once the table is created.

Modifies the provisioned throughput settings, global secondary indexes, or DynamoDB Streams settings for a given table.

Solution:-

Please create a new table with redefined key attributes and copy the data from old table to new table.

Related