In this blog, I will set up AWS SNS services to notify me through text messages and emails when the kit sends MQTT messages.
From AWS console home page, choose Amazon Simple Notification Service (SNS). If this is your first time using SNS, the following page will pop up. From here, you can create your first SNS topic.
By default, the SNS navigation tab is collapsed, but you can expand it by clicking the navigation button (step 3 as shown in the above screenshot). The navigation tab is on the left hand side of the web page. You can set up SNS service using the following steps. First, as shown below, you need to create a SNS topic.
Next, you need to create SMS and email subscriptions to the SNS topic. Click either of the two highlighted two buttons below. Please remember the ARN string because you will need it for creating the rule triggering the SMS/email notification.
After click either Create subscription button, it will open a new page as shown below.
Next, you can create the email subscription similar to the creation of SMS subscription. These subscriptions may need confirmation, for instance, AWS send an email to the subscribed email address for your confirmation. Once you confirmed your subscription, you should see two items as shown below.
Next, to trigger SNS services, you need to set up a rule in AWS IoT where your IoT data is first received in AWS system. Go to the top bar on the web page, click on Services pull-down menu, choose IoT Core. As shown below, go to Act -> Rules page, then click Create a rule button.
Following steps shown below to create your own rule. For your own application, you have to replace the query with your own IoT topic (replace 'iotdemo/topic/1'). Next, you need to link the rule to SNS topic we created above by clicking Add action button.
Select SNS as the action.
First, choose the SNS topic you created above. For IoT demo application, choose RAW as message format. For your own application, you may use JSON format. If you don't have a role for this, the system will automatically creates MySNSRole role and just select it then click on Update to attach the policy.
To finish the rule creation, click on Create rule button.
At this point, your SNS set up and link to IoT has completed. To do a quick test, you can use IoT's testing capability. Once you push the IoT topic linked to the SNS service, you should receive both SMS and email messages.
The following two phone screenshots show both SMS and email messages generated by the IoT demo application.













