sophist_pt
sophist_pt

Reputation: 329

Creating dynamodb table using aws cli "--cli-input-json"

i have been trying to create a dynamo db table using the following json(testbootstraptable.json) file:

{
        "AttributeDefinitions": [
            {
                "AttributeName": "test1",
                "AttributeType": "S"
            },
            {
                "AttributeName": "test2",
                "AttributeType": "S"
            }
        ],
        "TableName": "BOOTSTRAP_TEST_TBL",
        "KeySchema": [
            {
                "AttributeName": "test1",
                "KeyType": "HASH"
            },
            {
                "AttributeName": "test2",
                "KeyType": "RANGE"
            }
        ],
        "ProvisionedThroughput": {
            "NumberOfDecreasesToday": 0,
            "ReadCapacityUnits": 35,
            "WriteCapacityUnits": 35
        }
}

I have tried multiple times with different variations based on google search but keep getting the following error:

Error parsing parameter 'cli-input-json': Invalid JSON: Expecting value: line 1 column 1 (char 0)
JSON received: testbootstraptable.json

AWS Command:

$ aws dynamodb create-table --cli-input-json testbootstraptable.json --region us-west-2

Upvotes: 3

Views: 7179

Answers (1)

John Hanley
John Hanley

Reputation: 81464

Add "file://" to testbootstraptable.json

aws dynamodb create-table --cli-input-json file://testbootstraptable.json --region us-west-2

Also, delete the following line as it is not correct: "NumberOfDecreasesToday": 0,

Upvotes: 13

Related Questions