def lambda_handler()

in src/ddb-stream-processor/lambda_function.py [0:0]


def lambda_handler(event, context):
    print("Received event: " + json.dumps(event, indent=2))
    
    print("Filtering trip completion records ... InProgress")
    completedTripInfoList = getTripCompletionRecords(event['Records'])
    print("Filtering trip completion records ... Completed")
    
    if(len(completedTripInfoList) > 0 ):
        print("Create insert SQL commands ... InProgress")
        insertSQLQueries = createInsertSQLQueries(completedTripInfoList)
        print("Create insert SQL commands ... Completed")
     
        print("Publish completed trip information ... InProgress")
        pusblishTripCompletionInfo(insertSQLQueries)
        print("Publish completed trip information ... Completed")
    else:
        print("No Trip Completion Records found.")
    
    return 'Successfully processed {} records.'.format(len(event['Records']))