You now create an AWS IoT rule which will call Lambda function to process the messages from the device to AWS IoT core.
-
On the AWS IoT Core console. Click on Rules menu under Act in the left and then click on the Create a rule button.
-
On the next screen, enter dojoiotrule for the rule name. Type in SELECT * FROM ‘iot/dojoinbound’ for the Rule query statement. In this configuration, the topic name is iot/dojoinbound. The rule is reading all the messages coming to the topic. You also have choice to filter the messages for the rule. Next, click on the Add action button to add action for the rule.
-
On the next screen, there are many different types of actions to handle the messages. Select Send a message to a Lambda function as an option and click on the Configure action button.
-
On the next screen, select dojolambdafunction as the function name and click on the Add action button.
-
It comes back to the rule configuration screen with the action configured. Click on the Create rule button in the bottom of the screen.
-
The rule is created in no time. All set. In the next step, you will use MQTT client as the device simulator to send messages to the AWS IoT Core.