# Example Lambda

## Overview
This serves as an example of a lambda processor. You can copy this directory
over and replace occurrences of *example_lambda* and *example-lambda* with the name of the new
lambda.

Royalty processor lambdas are executed as a part of an accounting workflow.

Lambda functions will receive an abacus_event JSON object as an argument.

Functions are expected to act as a client of graphql or RESTful endpoints
to perform processing on accounting records.

## Running
To run the function with a mock event, execute the command:
> make run

## Deployment
Deployment is managed by [zappa](https://github.com/Miserlou/Zappa).
The scripting is in `deploy.sh`, and the configuration is in `zappa_settings.json`.

> In order to deploy archives larger than 50MB, use the zappa 'slim_handler' option  
> Refer to [snapshot_exchange_rates](../snapshot_exchange_rates) examples of using this option with a custom `cli.py` and `handler.py`

## Integration testing
OWS services can be added to the `docker-compose.yml` file in order to test
integrations.
Snowflake data fixtures can be staged in the ROYALTY_ACCOUNTING.TEST schema.
