dynamoStreamPublisher/handler.js
// pushes a single dynamo record to SNS
pushes a single dynamo record to SNS
pushes a single dynamo record to SNS
function publishSingleRecord(message) {
  const arn = message.eventSourceARN;
  message.table = arn.substring(arn.lastIndexOf("table/") + 6, arn.lastIndexOf("/stream"));
  var params = {
    Message: JSON.stringify(message),
    MessageStructure: 'raw',
    TopicArn: 'arn:aws:sns:us-east-1:<REDACTED>:DBStream'
  };
  console.log('going to publish: ' + JSON.stringify(params));
  return sns.publish(params).promise();
}
function publishSingleRecord ( message ) { const arn = message . eventSourceARN ; message . table = arn . substring ( arn . lastIndexOf ( "table/" ) + 6 , arn . lastIndexOf ( "/stream" ) ) ; var params = { Message : JSON . stringify ( message ) , MessageStructure : 'raw' , TopicArn : 'arn:aws:sns:us-east-1:<REDACTED>:DBStream' } ; console . log ( 'going to publish: ' + JSON . stringify ( params ) ) ; return sns . publish ( params ) . promise ( ) ; }
pushes a single dynamo record to SNS
pushes a single dynamo record to SNS
//push on SNS /* required */