1
Amazon DynamoDBのローカルバージョンをダウンロードしました。シェルを使用してテーブルを作成しようとしています。私はシェルからコードを実行すると、それは私にエラーを与える:ローカルDynamoDBでテーブルを作成できません
"message":"The security token included in the request is invalid."
"code":"UnrecognizedClientException"
"time":"2017-04-27T12:50:35.880Z"
"statusCode":400
"retryable":false
は、コードを作成している:
var dynamodb = new AWS.DynamoDB();
var params = {
"AttributeDefinitions": [
{
"AttributeName": "UserId",
"AttributeType": "N"
},
{
"AttributeName": "FirstName",
"AttributeType": "S"
},
{
"AttributeName": "LastName",
"AttributeType": "S"
},
{
"AttributeName": "CellPhoneNumber",
"AttributeType": "N"
}
],
"TableName": "Users",
"KeySchema": [
{
"AttributeName": "UserId",
"KeyType": "HASH"
},
{
"AttributeName": "CellPhoneNumber",
"KeyType": "RANGE"
}
],
"LocalSecondaryIndexes": [
{
"IndexName": "UserIndex",
"KeySchema": [
{
"AttributeName": "UserId",
"KeyType": "HASH"
},
{
"AttributeName": "CellPhoneNumber",
"KeyType": "RANGE"
}
],
"Projection": {
"ProjectionType": "KEYS_ONLY"
}
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
}
}
dynamodb.createTable(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
私は地元DynamoDBの中にテーブルを作成するにはどうすればよいですか?まずDBを作成する必要がありますか?私はいつもSQLで作業していて、NoSQLを使用しているのは初めてです。
上で実行する必要があります:// localhostを:8000 /シェル/)、私はこのエラーを取得します: " ReferenceError:requireが定義されていません " – User2682
スクリプトを更新しました。 – notionquest