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:
- Check if the config file to see if we call the api
- Make api call, depending on the config file in the previous step
- Save the job results to DynamoDB table
- Send notifications on job results
Parameters: - event (dict, required) –
file is deposited in S3 bucket
- context (object, required) –
Lambda Context runtime methods and attributes
Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
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: - event (dict, required) –
api gateway is used to call this function
- context (object, required) –
Lambda Context runtime methods and attributes
Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
Returns: Success or failure of function
Return type: int
- event (dict, required) –