为什么AWS Cloud Formation中的Stack Creation会产生错误:"预配的吞吐量不能留空"?

时间:2014-12-11 15:13:36

标签: amazon-web-services amazon-cloudformation

AWS Cloud Formation中的堆栈创建出现此错误:

Provisioned Throughput cannot be left blank

即使我的JSON包含该字段?

{"AWSTemplateFormatVersion": "2010-09-09",
    "Description": "CloudFormation template for My_Table”,
    "Resources": {
        "myDynamoDBTable": {
            "Type": "AWS::DynamoDB::Table",
            "Properties": {
                "AttributeDefinitions": [
                    {
                        "AttributeName": “abc”,
                        "AttributeType": "N"
                    },
                    {
                        "AttributeName": “xyz”,
                        "AttributeType": "S"
                    },
                    {
                        "AttributeName": “fgh”,
                        "AttributeType": "S"
                    }
                ],
                "KeySchema": [
                    {
                        "AttributeName": “abc”,
                        "KeyType": "HASH"
                    },
                    {
                        "AttributeName": “fgh”,
                        "KeyType": "RANGE"
                    }
                ],
                "ProvisionedThroughput": {
                    "ReadCapacityUnits": "5",
                    "WriteCapacityUnits": "5"
                },
                "TableName": “My_Table",
                "GlobalSecondaryIndexes": [
                    {
                        "IndexName": “xyz-index",
                        "KeySchema": [
                            {
                                "AttributeName": “xyz”,
                                "KeyType": "HASH"
                            }
                        ],
                        "Projection": {
                            "ProjectionType": "ALL"
                        }
                    }
                ]
            }
        }
    }
}

2 个答案:

答案 0 :(得分:1)

模板缺少GlobalSecondaryIndexes部分的预配置吞吐量参数:

            "GlobalSecondaryIndexes": [
                {
                    "IndexName": "xyz-index",
                    "KeySchema": [
                        {
                            "AttributeName": "xyz",
                            "KeyType": "HASH"
                        }
                    ],
                    "Projection": {
                        "ProjectionType": "ALL"
                    },
                    "ProvisionedThroughput" : {         <== This bit here
                        "ReadCapacityUnits" : "5",
                        "WriteCapacityUnits" : "5"
                    }
                    ...

请参阅:DynamoDB Global Secondary Indexes

答案 1 :(得分:0)

模板看起来很好,但在My_tabls"之前有一个奇怪的角色,它应该是“,而不是”

"TableName": “My_Table",

中部分类似的奇怪字符GlobalSecondaryIndexes