【发布时间】:2017-06-14 10:05:28
【问题描述】:
我有以下模板,我在 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 文件,为堆栈命名并单击下一步。一段时间后,我收到错误消息,提示 Property AttributeDefinitions 与表的 KeySchema 和二级索引不一致
【问题讨论】:
-
CloudFormation Linter 规则可帮助您更快地捕捉到更多信息:github.com/aws-cloudformation/cfn-python-lint/pull/1284
标签: amazon-web-services amazon-dynamodb amazon-cloudformation