CloudFormation 坚持我的 DynamoDB 创建 JSON 无效..但我看不出如何
CloudFormation insists my DynamoDB creation JSON is invalid .. but I can't see how
这是我的对流层生成的(DynamoDB 部分)JSON:
"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,就此而言)的新手,所以我可能会遗漏一些非常明显的东西,但目前对我来说并不明显。
我用谷歌搜索了一下,只发现了一个提到这个错误的地方,它更多地与开发人员和 CF 之间的层有关,而不是 CF 本身。
谁能指出我的模板有什么问题?
这是我对 DynamoDB 的误解。应在此处定义的 only 属性将用作键。因此,将 AttributeDefinitions 数组更改为以下内容解决了问题:
"AttributeDefinitions": [
{
"AttributeName": "audit_id",
"AttributeType": "S"
}
]
这是我的对流层生成的(DynamoDB 部分)JSON:
"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,就此而言)的新手,所以我可能会遗漏一些非常明显的东西,但目前对我来说并不明显。
我用谷歌搜索了一下,只发现了一个提到这个错误的地方,它更多地与开发人员和 CF 之间的层有关,而不是 CF 本身。
谁能指出我的模板有什么问题?
这是我对 DynamoDB 的误解。应在此处定义的 only 属性将用作键。因此,将 AttributeDefinitions 数组更改为以下内容解决了问题:
"AttributeDefinitions": [
{
"AttributeName": "audit_id",
"AttributeType": "S"
}
]