decisionMaker/handler.js
// re-submit trigger for storage - false alarm
re-submit trigger for storage - false alarm
re - submit trigger for storage - false alarm
function resetTrigger(trigger, callback) {
  delete trigger.averages;
  delete trigger.lastPrice;
  var params = {
    Message: JSON.stringify(trigger),
    MessageStructure: 'raw',
    TopicArn: 'arn:aws:sns:us-east-1:<REDACTED>:AlertTriggerRegister'
  };
  console.log('submitting trigger reset message: ' + JSON.stringify(params));
  sns.publish(params, function(err, data) {
    if (err) {
      console.log(err, err.stack); 
    } else {
      console.log("successfully published: " + JSON.stringify(data));
      callback(null, {
        "result": "successfully published: " + JSON.stringify(data)
      });
    } 
  });
}
function resetTrigger ( trigger , callback ) { delete trigger . averages ; delete trigger . lastPrice ; var params = { Message : JSON . stringify ( trigger ) , MessageStructure : 'raw' , TopicArn : 'arn:aws:sns:us-east-1:<REDACTED>:AlertTriggerRegister' } ; console . log ( 'submitting trigger reset message: ' + JSON . stringify ( params ) ) ; sns . publish ( params , function ( err , data ) { if ( err ) { console . log ( err , err . stack ) ; } else { console . log ( "successfully published: " + JSON . stringify ( data ) ) ; callback ( null , { "result" : "successfully published: " + JSON . stringify ( data ) } ) ; } } ) ; }
re-submit trigger for storage - false alarm
re - submit trigger for storage - false alarm
//publish back to SNS //arn:aws:sns:us-east-1:<REDACTED>:AlertTriggerRegister /* required */ // push to lambda that stores items back on the trigger table // an error occurred // successful response