我在Cloudformation UI中使用以下模板来创建dynamoDB表。我想创建一个表,其中PrimaryKey作为ID,sortKey作为Value
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "DB Description",
"Resources" : {
"TableName" : {
"Type" : "AWS::DynamoDB::Table",
"Properties" : {
"AttributeDefinitions": [ {
"AttributeName" : "ID",
"AttributeType" : "S"
}, {
"AttributeName" : "Value",
"AttributeType" : "S"
} ],
"KeySchema": [
{
"AttributeName": "ID",
"KeyType": "HASH"
}
]
},
"TableName": "TableName"
}
}
}
在CF UI上,我单击新堆栈,指向template
本地计算机上的文件,为堆栈命名,然后单击下一步。一段时间后,我收到错误消息,指出属性AttributeDefinitions与表的KeySchema和辅助索引不一致