Unknown parameter in input: "BillingMode"

0

My old DynamoDB script that works:

{
    "AttributeDefinitions": [
        {
            "AttributeName": "userId",
            "AttributeType": "S"
        }
    ],
    "TableName": "DEV_Users",
    "KeySchema": [
        {
            "AttributeName": "userId",
            "KeyType": "HASH"
        }
    ],
    "ProvisionedThroughput": {
        "ReadCapacityUnits": 1,
        "WriteCapacityUnits": 1
    }
}

My two attempts at updating this script to work for on-demand:

{
    "AttributeDefinitions": [
        {
            "AttributeName": "userId",
            "AttributeType": "S"
        }
    ],
    "TableName": "TEMP_Users",
    "KeySchema": [
        {
            "AttributeName": "userId",
            "KeyType": "HASH"
        }
    ],
    "BillingMode": "PAY_PER_REQUEST"
}

And also

{
    "AttributeDefinitions": [
        {
            "AttributeName": "userId",
            "AttributeType": "S"
        }
    ],
    "TableName": "TEMP_Users",
    "KeySchema": [
        {
            "AttributeName": "userId",
            "KeyType": "HASH"
        }
    ],
    "BillingModeSummary": [
		{
			"BillingMode ": "PAY_PER_REQUEST"
		}
    ]
}

Both attempts result in:

Parameter validation failed:
Missing required parameter in input: "ProvisionedThroughput"
Unknown parameter in input: "BillingMode", must be one of: AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, ProvisionedThroughput, StreamSpecification, SSESpecification

Am I doing anything wrong? Looks like I am complying with the create-table CLI? https://docs.aws.amazon.com/cli/latest/reference/dynamodb/create-table.html

已提問 5 年前檢視次數 434 次
3 個答案
0
已接受的答案

I believe you might be using an older version of aws cli and hence its not able to recognize recently added parameter 'BillingMode'. Can you update aws cli using following command 'sudo pip3 install --upgrade awscli' to latest version and then retry.

AWS
已回答 5 年前
0

Thank you - this was the problem.

已回答 5 年前
0

I am glad issue is resolved.

AWS
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南