Last active
September 17, 2021 14:48
-
-
Save gbvanrenswoude/fb23fd6b47e7c80cdc3fe1ca1327ce4e to your computer and use it in GitHub Desktop.
eventbridge-lambda-model-premade-AWSEvent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from schema.your_schema_openapiv3 import Event | |
from schema.your_schema_openapiv3 import AWSEvent | |
from schema.your_schema_openapiv3 import Marshaller | |
import json | |
def lambda_handler(event, context): | |
"""function | |
Parameters | |
---------- | |
event: dict, required | |
context: object, required | |
Lambda Context runtime methods and attributes | |
Returns | |
------ | |
An updated input event file | |
""" | |
# Deserialize event into strongly typed object | |
awsEvent: AWSEvent = Marshaller.unmarshall(event, AWSEvent) | |
detail: Event = awsEvent.detail | |
awsEvent.detail_type = "prefix " + awsEvent.detail_type | |
return Marshaller.marshall(awsEvent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment