Sym AWS Lambda Integration Helpers
Project description
sym-awslambda-py
Python modules to simplify Sym lambda integrations.
Dispatch Configuration
Sym provides a standard dispatch handler that you can use to automatically route Sym messages to the right handler.
First import the dispatch function in your main handler.py
file:
from sym.awslambda.dispatch import dispatch
Then in your Terraform lambda declaration, set handler.dispatch
as your handler
value:
resource "aws_lambda_function" "sym" {
...
handler = "handler.dispatch"
...
}
sym_action decorator
The Sym dispatcher will delegate incoming messages to the appropriate handler based on the sym_action
decorator:
from sym.awslambda.decorators import sym_action
@sym_action("approve")
def approve(approval, context):
print("Target reason:", approval.request.meta.reason)
....
Message types
The messages that sym actions receive are defined as protobufs in the Sym Types repo.
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
sym-awslambda-1.0.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for sym_awslambda-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3a0e02fc9e25dc6738e72770e8c6aa6f01006a394fe025df31e498ec348704 |
|
MD5 | 7e4cc7fe690b1aeb268ec6ec47c727c5 |
|
BLAKE2b-256 | 36650ee813fa5383c3de19a3d2fda3abab9b8ce914700a730266ab9af9e7132f |