Saurabh Bhatia
Saurabh Bhatia

Reputation: 789

Why is Stack Creation in AWS Cloud Formation is giving error: "Provisioned Throughput cannot be left blank"?

Stack Creation in AWS Cloud Formation is giving this error:

Provisioned Throughput cannot be left blank

Even though my JSON contains that field?

{"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"
                        }
                    }
                ]
            }
        }
    }
}

Upvotes: 0

Views: 470

Answers (2)

BMW
BMW

Reputation: 45243

The template looks fine, but there is a strange character just before My_tabls", it should be ", not “

"TableName": “My_Table",

similar strange character in part of GlobalSecondaryIndexes as well.

Upvotes: 0

John Rotenstein
John Rotenstein

Reputation: 269292

The template is missing the Provisioned Throughput parameter for the GlobalSecondaryIndexes section:

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

See: DynamoDB Global Secondary Indexes

Upvotes: 2

Related Questions