mardi 24 février 2015

Node.js - can't create table in dynamodb local - aws

I'm using dynamoDB-local with nodejs code.


I have the following code:



var aws = require("aws-sdk")
aws.config.update({"accessKeyId": "aaa",
"secretAccessKey": "bbb",
"region": "us-east-1"})

var awsdb = new aws.DynamoDB({ endpoint: new aws.Endpoint("http://localhost:8000") });

awsdb.createTable({
TableName: 'myTbl',
AttributeDefinitions: [
{ AttributeName: 'aaa', AttributeType: 'S' },
],
KeySchema:[
{ AttributeName: 'aaa', KeyType: 'HASH' }
]
}, function() {
awsdb.listTables(function(err, data) {
console.log(data)
});
});


But it isn't creating the table. I'm getting { TableNames: [] } in logs.





Aucun commentaire:

Enregistrer un commentaire