libs/ingest-csv.js
function invokeLambda(bucket, key, nextFileNum, lastFileNum, arn, retries) {
    // figure out if there's a next file to process
    if (nextFileNum && arn) {
      const stepfunctions = new AWS.StepFunctions()
      const params = {
        stateMachineArn: arn,
        input: JSON.stringify({ bucket, key, currentFileNum: nextFileNum, lastFileNum, arn, retries}),
        name: `ingest_${nextFileNum}_${Date.now()}`
      }
      stepfunctions.startExecution(params, function(err, data) {
        if (err) {
          console.log(err, err.stack)
        } else {
          console.log(`launched ${JSON.stringify(params)}`)
        }
      }) 
    }
}
function invokeLambda(bucket, key, nextFileNum, lastFileNum, arn, retries) {
    // figure out if there's a next file to process
    if (nextFileNum && arn) {
      const stepfunctions = new AWS.StepFunctions()
      const params = {
        stateMachineArn: arn,
        input: JSON.stringify({ bucket, key, currentFileNum: nextFileNum, lastFileNum, arn, retries}),
        name: `ingest_${nextFileNum}_${Date.now()}`
      }
      stepfunctions.startExecution(params, function(err, data) {
        if (err) {
          console.log(err, err.stack)
        } else {
          console.log(`launched ${JSON.stringify(params)}`)
        }
      }) 
    }
}
function invokeLambda ( bucket , key , nextFileNum , lastFileNum , arn , retries ) { // figure out if there's a next file to process if ( nextFileNum && arn ) { const stepfunctions = new AWS . StepFunctions ( ) const params = { stateMachineArn : arn , input : JSON . stringify ( { bucket , key , currentFileNum : nextFileNum , lastFileNum , arn , retries } ) , name : ` ${ nextFileNum } ${ Date . now ( ) } ` } stepfunctions . startExecution ( params , function ( err , data ) { if ( err ) { console . log ( err , err . stack ) } else { console . log ( ` ${ JSON . stringify ( params ) } ` ) } } ) } }
kick off processing next CSV file
kick off processing next CSV file