We expect this program to be running on a virtual environment on pyton 3.8

In order to create a virtual environment please run the following command inside of this folder:

python3 -m venv .

Please not that you may need to install python venv packages.

Once configured please run the following command (it might be pip3)


to active virtual env: 

source myvenv/bin/activate

pip3 install mysql-connector-python
pip3 install PyGithub


As this is a lambda function we need to send the entire folder to amazon.

Please use the following command to create a zip file with all the dependencies 
and the lambda function itself (only tested on linux)


deactivate
cd /lib/python3.7/site-packages
zip -r ../../../../my-deployment-package.zip 
cd ../../../../
zip -g my-deployment-package.zip src/lambda_function.py

More info can be found at: 

https://docs.aws.amazon.com/lambda/latest/dg/python-package.html


OR if you prefer use the included docker.

#### build the image
docker build . -t zendesk-integration:0.1 
#### run as a deamon container
docker run -d --name zendesk-integration zendesk-integration:0.1
##### copy the package
docker cp zendesk-integration:/app/my-deployment-package.zip .
##### stop and delete the container.
docker stop zendesk-integration && docker rm zendesk-integration



docker build . -t zendesk-integration:0.1 
docker run -d --name zendesk-integration zendesk-integration:0.1
docker cp zendesk-integration:/app/my-deployment-package.zip .
docker stop zendesk-integration && docker rm zendesk-integration



#### Back end architecture:

![alt text](zd_integration.jpg)


Data FLOW:

1 - From Zendesk APP TSEs will add the github issue to the mysql

2 - When adding the github issue the lambda function will go to github.com and capture some metadada about the ticket

3 - After confirming and capturing the metadata of the issue the zendesk application will list all the github issues listed

4 - The mysql (aurora) will contain customer name and customer id for later integration with SalesForce.
