The msk event will automatically handle many common things done when eventing off a generic event invoked manually or programmatically.
Developers then have the ability to further extend that functionality with custom middleware.
Below is a full list of all the configurations available and examples of their use.
Examples
Don't like reading documentation? Then look at
our examples, which can be deployed
in 1 command into your AWS account!
fromacai_aws.firehose.requirementsimportrequirementsfromacai_aws.commonimportlogger@requirements(before=log_something,data_class=SomeClass,raise_operation_error=True,raise_body_error=True,schema='service/openapi.yml',required_body='v1-msk-body',# or jsonschema dictafter=alert_something,)defhandle(event):forrecordinevent.records:logger.log(log=record.body)# example data classclassSomeClass:def__init__(self,record):fork,vinrecord.body.items():setattr(self,k,v)# example before functiondeflog_something(records,requirements):logger.log(log=event.body)# example after functiondefalert_something(event,result,requirements):if'something'inresultand'alert'inrequirements:logger.log(log=event)