I get the following error when I try to load this cloudformation template to create a dynamo db table
Property AttributeDefinitions is inconsistent with the KeySchema of the table and the secondary indexes
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"TableName": {
"Description": "Table name to use",
"Type": "String",
"Default": "test-user-unique-ids"
},
"ReadCapacityUnits": {
"Description": "Provisioned read throughput",
"Type": "Number",
"Default": "100",
"MinValue": "1",
"MaxValue": "10000",
"ConstraintDescription": "must be between 1 and 10000"
},
"WriteCapacityUnits": {
"Description": "Provisioned write throughput",
"Type": "Number",
"Default": "100",
"MinValue": "1",
"MaxValue": "10000",
"ConstraintDescription": "must be between 1 and 10000"
}
},
"Resources": {
"testUserUniqueIds": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"TableName": {
"Ref": "TableName"
},
"AttributeDefinitions": [
{
"AttributeName": "unique_id",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "guid",
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": {
"Ref": "ReadCapacityUnits"
},
"WriteCapacityUnits": {
"Ref": "WriteCapacityUnits"
}
}
}
}
}
}