【以下的问题经过翻译处理】 我的旧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