Book Image

Learning AWS IoT

By : Agus Kurniawan
Book Image

Learning AWS IoT

By: Agus Kurniawan

Overview of this book

The Internet of Things market increased a lot in the past few years and IoT development and its adoption have showed an upward trend. Analysis and predictions say that Enterprise IoT platforms are the future of IoT. AWS IoT is currently leading the market with its wide range of device support SDKs and versatile management console. This book initially introduces you to the IoT platforms, and how it makes our IoT development easy. It then covers the complete AWS IoT Suite and how it can be used to develop secure communication between internet-connected things such as sensors, actuators, embedded devices, smart applications, and so on. The book also covers the various modules of AWS: AWS Greengrass, AWS device SDKs, AWS IoT Platform, AWS Button, AWS Management consoles, AWS-related CLI, and API references, all with practical use cases. Near the end, the book supplies security-related best practices to make bi-directional communication more secure. When you've finished this book, you'll be up-and-running with the AWS IoT Suite, and building IoT projects.
Table of Contents (14 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Building your IoT project with AWS IoT Button


We will continue to develop IoT projects using AWS IoT Button. We will use the Lambda rule and trigger to perform a certain action. For the demo, we save a message from AWS IoT Button into the AWS database, DynamoDB.

You can see this scenario in the following figure. Each button clicked from AWS IoT Button will be filtered and then call AWS Lambda. Inside AWS Lambda, the program will store a message into the database, AWS DynamoDB:

Configuring AWS DynamoDB

Firstly, we create a table on AWS DynamoDB. You can open a browser and navigate to https://console.aws.amazon.com/dynamodb. Then, you can create a new table. For instance, we set the table name as aws-iot-button-db. We also set the primary key as msg-id with the String data type. You can see the AWS DynamoDB table configuration in the following screenshot:

With this we have successfully created AWS DynamoDB on Amazon AWS. Next, we will connect it with AWS Lambda.

Building Lambda and its rule

After...