I am using AWS SDK for nodejs and creating a dynamodb table from the code. It all works fine but i need auto scaling to be enabled for provisioned read and write capacity. This is the code i am trying
var params = {
TableName : "MyTable",
KeySchema: [
{ AttributeName: "Name", KeyType: "HASH"}, //Partition key
{ AttributeName: "time", KeyType: "RANGE" } //Sort key
],
AttributeDefinitions: [
{ AttributeName: "Name", AttributeType: "S" },
{ AttributeName: "time", AttributeType: "N" }
],
ProvisionedThroughput: {
ReadCapacityUnits: 5,
WriteCapacityUnits: 5
}
]
};
dynamodb.createTable(params, function(err, data) {
if (err) {
console.error("Unable to create table. Error JSON:", JSON.stringify(err, null, 2));
} else {
console.log("Created table. Table description JSON:", JSON.stringify(data, null, 2));
}
});
This creates a table with read and write capacity as 5 but with auto scaling disabled. I have seen a java sample where auto scaling is being handled from code but nothing for java script. Any suggestions on how to enable auto scaling from NodeJS will be very helpful . Thanks