Read before-The Ultimate Guide to AWS IoT Core: What it is, How it helps, and Real-World use Cases. Mini-Project-Intro
Tags: awsiotcore, terraform, iot, bigdata
Published: 2023-03-12 00:57:09

It has been a while since I last wrote anything, but here is the mini-project I promised you all. In this multi-part series, we will explore and learn about AWS IoT Core. We will learn how to safely collect real-time data, write it into an Amazon Timestream database, and create it using Terraform.

You might be asking yourself, why an Amazon Timestream database? If you read the Amazon Timestream database section of my database series, you already have enough understanding of why we are using it. However, if you have not read it yet, I invite you to read it [here](https://dev.to/aws-builders/amazon-timestream-h42) for a better understanding.

A few questions to start going:

* Have you ever thought about how the internet of things (IoT) works? 
* How do devices communicate with each other? 

* How do they share information? 

In this article, we will take a deep dive into AWS IoT Core and explore its features, benefits, and real-world use cases.

__What is AWS IoT Core?__ 

AWS IoT Core is a managed cloud service that enables communication between internet-connected devices and cloud applications easily and securely. It provides a reliable connection between devices, and it can handle billions of messages each day. AWS IoT Core uses MQTT (Message Queuing Telemetry Transport) as its messaging protocol, which is a lightweight and efficient protocol designed for IoT devices.

__How it Helps?__

AWS IoT Core helps to simplify the process of creating and managing IoT applications. With AWS IoT Core, you can securely connect and manage devices, collect, and analyze data from these devices, and integrate this data with other AWS services. AWS IoT Core also provides security features such as device authentication, authorization, and encryption.

Let's explore some of the many industries and real-world use cases that can be implement with the help of AWS IoT core:

* Healthcare 
* Transportation
* Smart Building
* Agriculture 
* More ... 

__Healthcare:__ 

AWS IoT Core has been used to monitor the health of patients remotely. Medical devices such as blood pressure monitors, heart rate monitors, and glucose sensors can be connected to AWS IoT Core, which allows healthcare professionals to remotely monitor the health of patients.

__Agriculture:__ 

AWS IoT Core has been used to monitor crop growth and soil conditions. Sensors placed in the soil can collect data on soil moisture, temperature, and nutrient levels. This data can be used to optimize crop growth and increase yields.

__Smart Building:__

Smart Buildings are becoming increasingly popular as they offer a wide range of benefits such as energy efficiency, improved occupant comfort, and cost savings. AWS IoT can play a crucial role in enabling these benefits by providing a secure and scalable platform to connect, manage and analyze the data from the sensors and devices in a Smart Building. With AWS IoT, building owners and operators can monitor and control various building systems such as lighting, HVAC, security, and access control from a single platform, resulting in better energy management and increased operational efficiency. Additionally, AWS IoT can help building owners and operators make data-driven decisions and optimize building performance based on real-time insights.

__Transportation:__ 

AWS IoT Core has been used to monitor the performance of vehicles. Sensors placed in vehicles can collect data on fuel efficiency, engine performance, and tire pressure. This data can be used to optimize vehicle performance and reduce maintenance costs.

Diagram of what are we going to be building shown below.


![Diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oga49dsqkecimxvp5n9x.png) 

__Terraform code previous__
```
resource "aws_iot_thing" "iot_core" {
  name = "your-iot-core-thing"
}


resource "aws_iot_certificate" "iot_certificate" {
  active = true
}


resource "aws_iot_thing_principal_attachment" "iot_attachment" {
  principal = aws_iot_certificate.iot_certificate.arn
  thing = aws_iot_thing.iot_core.name
}



resource "aws_iot_topic_rule" "iot_rule" {
  name = "myiotrule"
  sql = "SELECT * FROM 'iot-core-topic'"
  sql_version = "2016-03-23"
  enabled     = true
  description = "Send data from the AWS IoT Core to Amazon Timestream Database"
}
```


Oh, right! What's next for us? We will dive into all of the AWS IoT resources that will build our project, such as IoT Thing, IoT Rule, IoT Certificate, and Policy. 

__Please stay tuned!__

[Next: From zero to hero a beginners guide to aws iot things, certificates, policies, rules and, topics](https://dev.to/aws-builders/from-zero-to-hero-a-beginners-guide-to-aws-iot-things-certificates-policies-rules-and-topics-5632)

[Project: From Installation to Database: How to connect your IoT devices with AWS IoT Core and Timestream using Terraform](https://dev.to/aws-builders/from-installation-to-database-how-to-connect-your-iot-devices-with-aws-iot-core-and-timestream-using-terraform-bb9)