1
votes

Is there a way to disable a Dynamodb stream using aws sdk javascript?

I need to stop streaming data to my lambda function while I'm doing some maintenance to other services.

1
Do you want the solution on Javascript only or is it ok to provide solution on AWS management console ?notionquest
I would like to know the solution on Javascript if it's possible. In the management console I already know where I can disable the stream.JosepB

1 Answers

2
votes

You can use updateTable API to disable the stream specification.

var dynamodb = new AWS.DynamoDB();
var params = {
  TableName: 'yourTableName', 
  StreamSpecification: {
    StreamEnabled: true    
  }
};

dynamodb.updateTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Note:-

I have not tested it as I don't have Streams on my table. However, the above code should work.