Skip to content

Instantly share code, notes, and snippets.

@andredtr
Created October 30, 2019 22:15
Show Gist options
  • Select an option

  • Save andredtr/fcb1a694a9944ba30374c2f7182e77f6 to your computer and use it in GitHub Desktop.

Select an option

Save andredtr/fcb1a694a9944ba30374c2f7182e77f6 to your computer and use it in GitHub Desktop.
var params = {
TableName: 'tableName',
KeySchema: [ // The type of of schema. Must start with a HASH type, with an optional second RANGE.
{ // Required HASH type attribute
AttributeName: 'id',
KeyType: 'HASH',
}
],
AttributeDefinitions: [ // The names and types of all primary and index key attributes only
{
AttributeName: 'id',
AttributeType: 'S',
},
],
ProvisionedThroughput: { // required provisioned throughput for the table
ReadCapacityUnits: 5,
WriteCapacityUnits: 5,
}
};
dynamodb.createTable(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment