How to track Continuous Job execution per Thing in AWS-IoT

332 views Asked by At

I use AWS IoT to manage Things. I have a Dynamic Thing Group with Continuous IoT Job attached, so every Thing eventually (based on conditions) can be added to this Group and a thing will be notified on a Job to be executed. This one works perfect.

Now I need to track Job SUCCEEDED event for every Thing (Job execution). How can I do this using AWS IoT services?

I was trying to do this using AWS IoT Rules with the following SQL expression:

SELECT * FROM '$aws/events/jobExecution/my-continuous-job-id/succeeded'

but without success, no events were observed. However, at the same time I can see that Job was successfully executed as in Thing as in the AWS IoT Web Console.

1

There are 1 answers

0
machin On BEST ANSWER

After some research I found the answer. So to handle job execution events one should activate this feature in AWS IoT Core explicitly which is not obvious from the first glance:

  • AWS Web Console:

AWS IoT -> Settings -> Manage Events -> Check "Job execution: success, failed, rejected, canceled, removed"

  • AWS CLI:

    aws iot update-event-configurations --event-configurations "{\"JOB_EXECUTION\":{\"Enabled\": true}}"
    
    

Docs: https://docs.aws.amazon.com/iot/latest/developerguide/iot-events.html