Deploy an End-to-End IoT Application

In this AWS Skills Builder lab I've connected virtual things using AWS IoT, published messages and visualised real-time data using a serverless web application leveraging AWS Lambda, Amazon API Gateway and Amazon S3.

The steps in this lab includes:

  • Set up AWS IoT

  • Create an IoT thing, policy, and certificate

  • Run a device simulator on Amazon EC2

  • Process and Visualise streaming data using a serverless app

There are few components that need to be created:

  • Thing – A thing is a logical representation of a device stored in IoT’s Registry.

  • Policy – You attach a policy to a certificate to dictate what the Thing is entitled to do on AWS IoT.

  • Certificates – Certificates are used for authentication. Things can communicate with AWS IoT via MQTT which is a machine-to-machine pub-sub protocol well-suited for IoT use cases given its low overhead and low resource requirements.

  • Rule – Rules leverages AWS IoT’s Rules Engine to dictate how messages sent from Things to AWS IoT are handled.

I launched an EC2 which has a Python app which acts a simulator for an IoT device that generates and sends different metrics to AWS IoT.

This EC2 instance had the appropriate credentials granted by the certificate to be allowed into AWS services, the messages sent by the simulator are filtered by a Rule and stored in DynamoDB table.

After running the simulator for few minutes, the messages started to appear on the table ready to be retrieved using API Gateway endpoint for authorised services.

The next step was to deploy static website hosted in S3, it retrieved the data from DynamoDB using API Gateway and visualised it in graphs.

As a conclusion, in this lab I've deployed a simulated IoT Thing, stored and visualised the sent metrics. I've had the chance to play around AWS IoT core service, DynamoDB, API Gateway, S3 and touches of Amazon Linux.