这是由Troposphere生成的JSON(其中包括DynamoDB部分):
"sandbox": {
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "audit_id",
"AttributeType": "S"
},
{
"AttributeName": "status",
"AttributeType": "S"
},
{
"AttributeName": "filename",
"AttributeType": "S"
},
{
"AttributeName": "file_detected_dt",
"AttributeType": "S"
},
{
"AttributeName": "time_taken",
"AttributeType": "N"
},
{
"AttributeName": "number_rows_processed_file",
"AttributeType": "N"
},
{
"AttributeName": "number_rows_created_db",
"AttributeType": "N"
},
{
"AttributeName": "info_messages",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "audit_id",
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": {
"Ref": "ReadCapacityUnits"
},
"WriteCapacityUnits": {
"Ref": "WriteCapacityUnits"
}
}
},
"Type": "AWS::DynamoDB::Table"
}
CloudFormation 在尝试启动 VPC 时出现错误:Property AttributeDefinitions is inconsistent with the KeySchema of the table and the secondary indexes
。但是... 真的吗?我将
audit_id
指定为唯一键,并且它绝对存在于 AttributeDefinitions 列表中。我非常新手 CF(以及 Dynamo),所以我可能会忽略一些极其明显的东西,但目前对我来说并不明显。我已经在 Google 上搜索了一番,只找到了一个与此错误有关的提及,而这更多地涉及开发人员和 CF 之间的层,而不是 CF 本身。
有人可以指出我的模板有什么问题吗?