I’m trying to create a simple table using DynamoDB JavaScript shell and I’m getting this exception:
{
"message&quo
I also had this problem and I'll post here what went wrong for me in case it helps someone else.
In my CreateTableRequest
, I had an empty array for the GlobalSecondaryIndexes
.
CreateTableRequest createTableRequest = new CreateTableRequest
{
TableName = TableName,
ProvisionedThroughput = new ProvisionedThroughput { ReadCapacityUnits = 2, WriteCapacityUnits = 2 },
KeySchema = new List
{
new KeySchemaElement
{
AttributeName = "Field1",
KeyType = KeyType.HASH
},
new KeySchemaElement
{
AttributeName = "Field2",
KeyType = KeyType.RANGE
}
},
AttributeDefinitions = new List()
{
new AttributeDefinition
{
AttributeName = "Field1",
AttributeType = ScalarAttributeType.S
},
new AttributeDefinition
{
AttributeName = "Field2",
AttributeType = ScalarAttributeType.S
}
},
//GlobalSecondaryIndexes = new List
//{
//}
};
Commenting out these lines in the table creation solved my problem. So I guess the list has to be null
, not empty.