To set up and deploy:
-
Clone this repo
-
Run
npm installto install serverless plugins. The serverless configuration uses the docker option inserverless-python-requirementsplugin to package the lambda. It usesserverless-pseudo-parametersto obtain the AWS account number from the deployment machine. -
Ensure docker is installed and running:
https://docs.docker.com/install/linux/docker-ce/ubuntu/
-
Update the environment variables in
serverless.ymlfor respective stages:- DOWNLOAD_URL: the url of the sql scripts zip file (custom.download_url..url)
- DB_HOST: MySql database endpoint (custom.source_db..host)
- DB_USER: MySql database username (custom.source_db..user)
- DB_P: MySql database password (custom.source_db..p)
- DB_NAME: MySql database name (custom.source_db..db)
-
Run
sls deploy --stage <stage>.