我一直试图使用以下json(testbootstraptable.json)文件创建dynamo表:
{
"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
}
}基于google搜索,我多次尝试使用不同的变体,但始终得到以下错误:
Error parsing parameter 'cli-input-json': Invalid JSON: Expecting value: line 1 column 1 (char 0)
JSON received: testbootstraptable.jsonAWS命令:
$ aws dynamodb create-table --cli-input-json testbootstraptable.json --region us-west-2发布于 2017-10-09 03:00:26
添加"file://“to testbootstraptable.json”
aws dynamodb create-table --cli-input-json file://testbootstraptable.json --region us-west-2另外,删除以下不正确的行:"NumberOfDecreasesToday":0,
发布于 2022-09-04 05:32:08
这与问题有关。
===
我最初是从JSON开始的,浪费了很多时间。
然后切换到GUI版本的创建表。
安装和使用的NoSQL Workbench for DynamoDB
下载链接:https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.settingup.html
https://stackoverflow.com/questions/46637946
复制相似问题