I am trying to add a GSI to an existing table on dynamo DB on local. I downloaded the last version(2.5.1) and run ti with:
`java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb -port 8001
Creatiing a table works fine:
aws dynamodb create-table
--endpoint-url http://localhost:8001
--table-name GameScores2
--attribute-definitions AttributeName=GameTitle,AttributeType=S AttributeName=UserId,AttributeType=S
--key-schema AttributeName=UserId,KeyType=HASH AttributeName=GameTitle,KeyType=RANGE
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=5
But when i try to create a GSI, just like in the amazon docs says:
aws dynamodb update-table --endpoint-url http://localhost:8001 --table-name GameScores2 --attribute-definitions AttributeName=TopScore,AttributeType=N --global-secondary-index-updates "[
{
\"Create\": {
\"IndexName\": \"GameTitleIndex\",
\"KeySchema\": [{\"AttributeName\":\"GameTitle\",\"KeyType\":\"HASH\"},
{\"AttributeName\":\"TopScore\",\"KeyType\":\"RANGE\"}],
\"Projection\":{
\"ProjectionType\":\"INCLUDE\",
\"NonKeyAttributes\":[\"UserId\"]
}
}
}
]"
Always get the error An error occurred (InternalFailure) when calling the UpdateTable operation (reached max retries: 9): The request processing has failed because of an unknown error, exception or failure.
I've searched all over internet but as far as I can see the syntax is ok, the bd is running, I have the last version...
Any idea of what can be happening?
Thanks.
If try to create the BD directly with the GSI if works without error. But I need to update and existing BD.