Build and deploy projects that use AWS Lambda.
$ albt --help
Usage: albt [OPTIONS] COMMAND [ARGS]...
AWS Lambda Build Tool
Build and deploy projects that use AWS Lambda.
Options:
--help Show this message and exit.
Commands:
deploy Deploy lambda functions
invoke Invoke lambda functions
new Create new lambda function
version Display albt version
- Simplify deploying and invoking lambda functions with less flags.
- Configure projects with yaml files instead of using multi line command line attributes.
- Automate zip file creation of lambda functions that use external packages or custom libraries.
- Integrate with services that use Lambda functions such as API Gateway.
Aws cli is a required pre-installation step, or at minimum creating a credentials file.
$ aws configure
This will prompt for credentials and set up the ~/.aws/credentials
file.
$ pip install albt
$ albt new . my_function
$ albt new . my_function --role=arn:aws:iam:::role/my_role --handler=my_handler
$ albt deploy .
$ albt deploy . lambda_function
$ albt deploy . lambda_function --region=us-west-2
$ albt invoke . my_function
$ albt invoke . my_function --payload=payloads/new.json --invoketype="RequestResponse"
Edit the function config yaml file.
vi my_function.yml
FunctionName: my-function-name
MemorySize: 128
Timeout: 15
Environment:
Variables:
Debug: 'True'
Add code to lambda function to retrieve environment variable
import os
DEBUG = os.environ['Debug'] == 'True'
$ virtualenv venv
$ . venv/bin/activate
$ pip install --editable .
python setup.py sdist
Install wheel
pip install wheel
Install universal
python setup.py bdist_wheel --universal
twine upload dist/*
gpg --detach-sign -a dist/albt-<VERSION>.tar.gz
twine upload dist/albt-<VERSION>.tar.gz dist/albt-<VERSION>.tar.gz.asc
- Add swagger file generation and import for api gateway lambda project
- Add cloud formation for project roles policies and resources
MIT