输入参数未知:"BillingMode"

0

【以下的问题经过翻译处理】 我的旧DynamoDB脚本可以正常工作:

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

我的两次尝试更新此脚本以支持按需工作:

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

以及

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

两次尝试都导致:

参数验证失败:
输入中缺少所需参数:“ ProvisionedThroughput”
输入中的未知参数:“BillingMode”,必须是以下之一:AttributeDefinitions,TableName,KeySchema,LocalSecondaryIndexes,GlobalSecondaryIndexes,ProvisionedThroughput,StreamSpecification,SSESpecification

我做错什么了吗?看起来我遵守了create-table CLI的要求吗? https://docs.aws.amazon.com/cli/latest/reference/dynamodb/create-table.html

profile picture
专家
已提问 9 个月前8 查看次数
1 回答
0

【以下的回答经过翻译处理】 我认为你可能正在使用较旧版本的AWS CLI,因此它无法识别最近添加的参数'BillingMode'。你能否使用以下命令更新AWS CLI到最新版本,然后重试:'sudo pip3 install --upgrade awscli'。

profile picture
专家
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则