Description
Use case
On AWS IoT, you can configure registry events, which send messages to MQTT topics on for example creation, updating or deletion of things.
This generates the underneath format.
{
"eventType" : "THING_EVENT",
"eventId" : "f5ae9b94-8b8e-4d8e-8c8f-b3266dd89853",
"timestamp" : 1234567890123,
"operation" : "CREATED|UPDATED|DELETED",
"accountId" : "123456789012",
"thingId" : "b604f69c-aa9a-4d4a-829e-c480e958a0b5",
"thingName" : "MyThing",
"versionNumber" : 1,
"thingTypeName" : null,
"attributes": {
"attribute3": "value3",
"attribute1": "value1",
"attribute2": "value2"
}
}
This can be useful when developing lambda functions getting triggered by these events.
@event_parser
def handle(event: IoTCRUDEvent, _: LambdaContext):
...
Solution/User Experience
Implement the AWSIoTCRUDEvent
so it's typed.
Alternative solutions
Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped