-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Missing parser type for IoT Core events #5891
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @basvandriel, thank you for opening this issue. As a rule of thumb, we have been adding models only for events that come from direct triggers of AWS Lambda functions. If I understand the documentation correctly, these are events that are sent by AWS IoT Core to specific IoT Topics instead. While I understand that you can create rules to make it so that events for these topics can end up triggering a Lambda function, I wonder if this type of event is more of an application-specific event rather than one that belongs to the library. Before moving forward with the review of the implementation, I'd like us maintainers to decide a criteria for deciding when to include this kind of events. I'm saying this mainly because there are many service integrations with IoT Core, many of which generate specific kinds of event, and I don't know if we should add them all. |
Hi @basvandriel! Thanks for opening this issue! I worked on a project using IoT Core a while ago and integrated it with SQS and DynamoDB as a topic target. I also added some Lambda as a target, but they were receiving generic events that have nothing in common. I see some potential in adding support for IoT as Event Source and Parser because I see a lot of customers using IoT jobs and events in their workloads. I also see that events have several fields in common, which makes sense to have a generalist class for those fields and specialized subclasses for each event type, like: Could you tell me in your architecture how the message from the MQTT topic is being sent to AWS Lambda? I want to confirm some architectural patterns before we proceed with this. |
Hi @leandrodamascena , in my case, I'm using an IOT Rule to trigger the Lambda. There I'm selecting the correct data from the MQTT topic. |
Hi @basvandriel! Thanks for sending me more information. We're going to move forward with this implementation, but we need to make some changes to this PR to add support for all event types. I see you added a generic way to capture all events on this page, but I think we can be more intentional and create classes for specific events like: class IOTCoreEventsBase(BaseModel): # all the common fields here
...
class IOCoreEventsThingEvent(IOTCoreEventsBase): # Specific fields for `THING_EVENT`
...
class IOCoreEventsThingTypeEvent(IOTCoreEventsBase): # Specific fields for `THING_TYPE_EVENT`
... We also need to add tests to make sure we can parse those events. Please reach out if you have any questions and we can work together to merge this PR. |
I'll pick this up ASAP |
Thanks a lot! Please let me know if you have any questions that I can help you! |
|
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.
This can be useful when developing lambda functions getting triggered by these events.
Solution/User Experience
Implement the
AWSIoTCRUDEvent
so it's typed.Alternative solutions
Acknowledgment
The text was updated successfully, but these errors were encountered: