This repo exists to make it easier to deploy the Service Desk webhook framework, coupled with Linaro's handlers, to AWS Lambda by using Zappa.
The sd-webhook-framework
and cl-sd-handlers
repositories must exist at the same level as this repository.
- Add a
configuration.jsonc
file, based off the sample configuration file included in thesd-webhook-framework
repo. ./copy-repos.sh
- copy the files from the two repos into a tree structure that can then be used by Zappa.pipenv install
- initialise the virtual environment and install the required production packages.pipenv shell
- start the virtual environment.pip3 install zappa
- install the Zappa tool.zappa init
- initialise Zappa.zappa deploy dev
- deploy to adev
stage.
Running zappa init
creates the file zappa_settings.json
based on the answers you provide. For an optimal deployment, and for double-checking that the base settings are correct, here is a sample configuration. Some sections have been replaced with <COMMENTS>
as these are project specific.
The complete "extra_permissions"
section can be removed if you are not using Vault authentication to retrieve secrets (i.e. all of the required passwords are specified in configuration.jsonc
).
{
"dev": {
"app_function": "app.APP",
"aws_region": "<YOUR PREFERRED REGION>",
"profile_name": "<AWS PROFILE NAME>",
"project_name": "<YOUR PREFERRED PROJECT NAME>",
"runtime": "python3.8",
"s3_bucket": "<ZAPPA BUCKET NAME>",
"keep_warm": false,
"exclude": [
".gitignore",
".vscode",
"boto3*",
"botocore*",
"copy-repos.sh",
"Pipfile*",
"README.md"
],
"extra_permissions": [
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": [
"<VAULT ROLE IF USING VAULT AUTHENTICATION>"
]
}
],
"log_level": "INFO"
}
}