Created
June 23, 2020 13:51
-
-
Save JesterXL/84ec5dcde2df4e64b48978f2087f6b39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var aws = require('aws-sdk'); | |
var sfn = new aws.StepFunctions(); | |
exports.handler = function(event, context, callback) { | |
console.log("event:", event) | |
console.log("context:", context) | |
console.log("callback:", callback) | |
let StateMachineArn = event.restart.StateMachineArn; | |
event.restart.executionCount -= 1; | |
event.AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID = event.executionID | |
let params = { | |
input: JSON.stringify(event), | |
stateMachineArn: StateMachineArn | |
}; | |
sfn.startExecution(params, function(err, data) { | |
if (err) callback(err); | |
else callback(null,event); | |
}); | |
} |
Author
JesterXL
commented
Jun 23, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment