publish-aws-lambda
Publish a Python package as a set of AWS lambda functions.
Does the following (given the location of a Python project)
-
Execute setup.py to package the project
-
Build a ZIP file with the requirements of this project (as required by AWS lambda)
-
Upload this ZIP file to S3 to the desired bucket
- Name of the object will be the name of the Python module to be scanned
-
For each of the specified module's lambda functions (decorated with the aws_lambda decorator):
- Create / Update / Delete the Lambda function in AWS
How to create a lambda function:
from publish_aws_lambda import aws_lambda
@aws_lambda(role_arn="arn:aws:iam::....:role/SomeRole", timeout=5)
def my_lambda(event, context):
print("Hello World!!!")
How to publish:
python -m publish_aws_lambda --module=my_module1 --module=my_module2 --bucket=s3bucketname