Posted On: Feb 23, 2021

Today, AWS launched a new feature for static analysis of your event “detector models” (representations of your IoT devices as state machines on the AWS cloud) in AWS IoT Events. The feature automatically performs 7 different analyses (see list in developer guide) of your models for potential syntax errors (e.g. bad expressions or payloads), structural issues (e.g. missing states or input triggers) and runtime errors (e.g. data type mismatch, missing data, potential to hit service limits, etc.). This debugging tool is particularly useful for complex detector models which have a large number of state changes, each with unique conditional logic triggered by multiple input data streams. The analysis summarizes diagnostic information of each of the 7 analyses by severity level ('info', 'warning', 'error') and identifies its location within the model (state, transition, action, etc.) to help you fix issues in your model even before publishing it.

For example, in the screenshot below, the attribute $input.AlarmInput.value is used as a Boolean and an integer in the same model. When you click on “Run analysis”, AWS IoT Events analyzes the expressions in your model to validate the data types of all inputs and warns you when such expressions could result in unexpected behavior in production. You can also use this feature to identify any validation issues that could prevent you from publishing the detector model.

Figure: AWS IoT Events detector model analysis results for model with multiple states, inputs, variables and transitions

AWS IoT Events is a fully managed service that makes it easy to detect and respond to events from IoT sensors and applications. To learn about its capabilities, log into the AWS Management Console, navigate to the AWS IoT Events console, and launch a demo detector model with sample inputs. You can also visit the AWS IoT Events website or the developer guide.