Q:

How to check DynamoDB Status while chaning Throughput of WriteUnits and wait for it to complete?

How can I wait for the DynamoDB active state?
I'd like to only upscale DynamoDB while no other process is scaling/updating the table up. Thus I was wondering how I can see whether any other process is scaling up an DynamoDB table?
According to the docs of dynamodb.waitFor Function I only can check for tableExists and tableNotExists status:
var params = {
  TableName: 'STRING_VALUE' /* required */
};
dynamodb.waitFor('tableExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

However this only seems to have states of 'tableExists' and 'tableNotExists' but seems not to allow to check for 'active' and 'updating' states? 
Background: I'm in an multi-worker environment there every worker tries to start an upscale in case write limits are reached. How this makes necessary to wait for any scalings/updates to be completed before reading the current provisioned throughputs from the table and start a new scaling action.

A:

Just got an answer from aws. My code above is working probably. On a change of througput, the table switches into the updating status. TableExists is waiting in case of the table beeing updated. It calls back as soon as the table switches back from updating to active. 
dynamodb.waitFor('tableExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

