###Overview
The purpose of this module is to correctly log out the AWS Lambda event and response payload to allow the firetail extension to then send it on to the firetail logging api
The firetail_handler is a decorator that wraps around an event handler function in a AWS Lambda to extract the event and response payloads into a base64 logging message.
###Supported Lambda Runtimes
- Python 3.7
- Python 3.8
- Python 3.9
###Installation Install the module with using pip
pip install -U firetail-lambda
Implementing Middleware in lambda function
from firetail_lambda import firetail_handler
@firetail_handler()
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": json.dumps({
"message": "Hello"
})
}
Multiple Event handlers
from firetail_lambda import firetail_handler
@firetail_handler()
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": json.dumps({
"message": "Hello"
})
}
@firetail_handler()
def lambda_handler_2(event, context):
return {
"statusCode": 200,
"body": json.dumps({
"message": "Hello 2"
})
}