Lambda Modules

workflow_main_funtion.py

The main module of the workflow

AWS.Services.Lambda.workflow_main_function.workflow_main_function.CheckIfEnabled(ENV_TYPE)

Function to check config to see if files should be processed

Parameters:ENV_TYPE (string, required) – dev, demo or prod
Returns:True if files should be proccessed, false otherwise
Return type:bool
AWS.Services.Lambda.workflow_main_function.workflow_main_function.lambda_handler(event, context)

Function to pass jobs to external api

Steps:
  1. Check if the config file to see if we call the api
  2. Make api call, depending on the config file in the previous step
  3. Save the job results to DynamoDB table
  4. Send notifications on job results
Parameters:
Returns:

Success or failure of function

Return type:

int

toggle_function.py

Module to allow administrators to turn the main workflow on or off

The config file, which will live in a workflow S3 bucket, will determine if the workflow processes the jobs. This function will edit the config file to set switch this to on or off, and an API gateway will give us access to this lambda function.

AWS.Services.Lambda.toggle_function.toggle_function.lambda_handler(event, context)

Function to change the configuration parameter that determines whether the application sends file data to the external API

Parameters:
Returns:

Success or failure of function

Return type:

int