I'm trying to build a template for each of my tables and I'm testing it with one table. However, I'm getting this error and I have no idea on how to fix it: One or more parameter values were invalid: Number of attributes in KeySchema does not exactly match number of attributes defined in AttributeDefinitions (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: NRTF448TGFEUGUB3H5UH37AGHBVV4KQNSO5AEMVJF66Q9ASUAAJG; Proxy: null)
The template that I'm using is this one:
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Resources" : {
"myddbtable": {
"Type" : "AWS::DynamoDB::Table",
"Properties" : {
"AttributeDefinitions" : [
{
"AttributeName": "phoneNumber",
"AttributeType": "S"
},
{
"AttributeName": "fname",
"AttributeType": "S"
},
{
"AttributeName": "lname",
"AttributeType": "S"
}
],
"BillingMode" : "PAY_PER_REQUEST",
"KeySchema" : [
{
"AttributeName" : "phoneNumber",
"KeyType": "HASH"
}
],
"TableName" : "UserTable2"
}
}
}
}
I tried putting the fname and the lname attributes on the KeySchema section with a KeyType of Range
and it didn't work either, any ideas?