# Lambda functions to obtain Vector Orders

This repository is based on
[this version](https://github.com/theorchard/docs/tree/29f6137a2c7064f8ed4ae67b909984149ebf8f2f/boilerplates/python-lambda)
of the generic boilerplate for AWS Lambda functions. Please refer to the
boilerplate for general information.


## Environment

Required environment vars could be found in the `.env.shadow` in the root
directory of this repository.


## How to work on these Lambda functions locally

Build:

    docker build -t ci-lambda build/

Run common tests:

    docker run --env-file=.env -it -v `pwd`:/reporoot ci-lambda /home/jenkins/common-module-tests.sh /reporoot/lambda

Run lambda-specific tests:

    docker run --env-file=.env -it -v `pwd`:/reporoot ci-lambda reporoot/build/build.sh dev /reporoot/lambda ar_to_ddb_sync

Deploy:

    AWS_PROFILE=orchard-dev ./build/deploy.sh dev lambda ar_to_ddb_sync vector_ar_to_ddb_sync

Run orders reprocessing Lambda manually from the CLI (the script is also suitable for a Jenkins job):

    AWS_PROFILE=orchard-dev Environment=dev ./lambda/reprocess_vector_orders/execute.sh 1436914,1437618 false
