AWS Lambda event handler manager
Project description
Domovoi is an extension to AWS Labs Chalice to handle AWS Lambda event sources other than HTTP requests through API Gateway. Domovoi lets you easily configure and deploy a Lambda function to run on a schedule or in response to an event source like an SNS event:
import json, boto3, domovoi
app = domovoi.Domovoi()
@app.scheduled_function("cron(0 18 ? * MON-FRI *)")
def foo(event, context):
context.log("foo invoked at 06:00pm (UTC) every Mon-Fri")
return dict(result=True)
@app.scheduled_function("rate(1 minute)")
def bar(event, context):
context.log("bar invoked once a minute")
boto3.resource("sns").create_topic(Name="bartender").publish(Message=json.dumps({"beer": 1}))
return dict(result="Work work work")
@app.sns_topic_subscriber("bartender")
def tend(event, context):
context.log(dict(beer="Quadrupel"))
Installation
pip install domovoi
Usage
First-time setup:
chalice new-project
Replace the Chalice app entry point with the Domovoi app entry point as above, then deploy the event handlers:
domovoi deploy
See the Chalice docs for information on how to set up Chalice configuration.
Links
Bugs
Please report bugs, issues, feature requests, etc. on GitHub.
License
Licensed under the terms of the Apache License, Version 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file domovoi-0.0.2.tar.gz
.
File metadata
- Download URL: domovoi-0.0.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 064e0ba9800c2b3d45e8d77319b565322ea0d6fcee0ae7519f80efa5fb6292b3 |
|
MD5 | 8d6dd185488f118390c23053643a70b6 |
|
BLAKE2b-256 | dca8229b43acb18f2c790f995bc031b7353f431ea91c3dd75dd15807a4ff3475 |
File details
Details for the file domovoi-0.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: domovoi-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e770c0490041f31f585528a625158919481b49e107740b6daea0763b3607af0c |
|
MD5 | 2387709dffdd32da3e18d67d0a085bec |
|
BLAKE2b-256 | a268c0338f4ee4938c7d5745dbd5d5e333108c2e0229403f202bc1add74c1dd7 |