PagaLu official application
Added Zappa --> Serverless support to the application
To deploy a zappa application on s3, and on the correct environment, follow the following steps:
- 1 - Run
zappa deploy dev
- if never deployed to zappa dev environemnt
- 2 - Run
zappa update dev
- if the application has been deployed and required updating
*** For cases that custom libraries are required (example based on instruction on https://forums.aws.amazon.com/thread.jspa?threadID=309588):
- Start with Amazon Linux on EC2 instance running t2.micro in us-east-1
- aws configure (and enter in your credentials)
- sudo yum update -y
- sudo su
- cd /usr/lib64/python2.7/dist-packages/
- rm -rf PIL
- cd /home/ec2-user
- sudo yum install gcc bzip2-devel ncurses-devel gdbm-devel xz-devel sqlite-devel openssl-devel tk-devel uuid-devel readline-devel zlib-devel libffi-devel
- wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
- tar -xJf Python-3.7.0.tar.xz
- cd Python-3.7.0
- ./configure --enable-optimizations
- make altinstall
- export PATH=$PATH:/usr/local/bin
- pip3.7 install pillow
- mkdir -p /home/ec2-user/lambda_layers/python/lib/python3.7/site-packages
- cd /usr/local/lib/python3.7/site-packages
- cp -r PIL /home/ec2-user/lambda_layers/python/lib/python3.7/site-packages
- cd /home/ec2-user/lambda_layers
- zip -r pill.zip *
- aws s3 cp pill.zip s3:///pill.zip
- In the Lambda console, I then created a Lambda Layer using the pill.zip from the s3 bucket and installed it.
- I then added the layer to the Python 3.7 Lambda function.
- I then verified that the following code worked successfully