Table: EmailMessages
EntityId - HashKey : String
Id - RangeKey : String
Name - String
Status - String
I would like to make a GlobalSecondaryIndex for Status
var request = new UpdateTableRequest
{
TableName = "EmailMessages",
GlobalSecondaryIndexUpdates = new List<GlobalSecondaryIndexUpdate>
{
new GlobalSecondaryIndexUpdate
{
Create = new CreateGlobalSecondaryIndexAction
{
IndexName = "GSI_EmailMessages_Status",
KeySchema = new List<KeySchemaElement>
{
new KeySchemaElement("Status", KeyType.HASH)
}
}
}
}
};
var client = DynamoDBManager.DBFactory.GetClient();
client.UpdateTable(request);
However the return error I get is a 500 error with no return text so I'm unsure on what I need to correct to make this work. I've dug through the documentation and I can't seem to find much help on creating a GSI for an existing table. Any help would be much appreciated