awslabs/lambda-refarch-iotbackend

Name: lambda-refarch-iotbackend

Owner: Amazon Web Services - Labs

Owner: AWS Samples

Description: Serverless Reference Architecture for creating an IoT Backend

Created: 2015-09-17 20:02:08.0

Updated: 2018-01-09 20:37:06.0

Pushed: 2017-06-09 17:39:22.0

Homepage:

Size: 37

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Serverless Reference Architecture: IoT Backend

The Internet of Things (IoT) Backend reference architecture (diagram) demonstrates how to use AWS Lambda in conjunction with Amazon Kinesis, Amazon DynamoDB, Amazon Simple Storage Service (Amazon S3), and Amazon CloudWatch to build a serverless system for ingesting and processing sensor data. By leveraging these services, you can build cost-efficient applications that can meet the massive scale required for processing the data generated by huge deployments of connected devices.

This repository contains sample code for all the Lambda functions depicted in this diagram as well as a AWS CloudFormation template for creating the functions and related resources. There is also a simple webpage that you can run locally to publish sample events and query the data from DynamodDB.

Running the Example

The entire example system can be deployed in us-east-1 using the provided CloudFormation template and an S3 bucket. If you would like to deploy the template to a different region, you must copy the Lambda deployment packages under the iot-backend prefix in the awslambda-reference-architectures bucket to a new S3 bucket in your target region. You can then provide this new bucket as a parameter when launching the template.

Choose Launch Stack to launch the template in the us-east-1 region in your account:

Launch Lambda IoT Backend into North Virginia with CloudFormation

Testing the Example

You can use the test webpage to test the system as follows:

  1. Save the testpage.html file to your local system.
  2. Open the downloaded file with a text editor and fill in the configuration values using the outputs of the CloudFormation stack launched in the previous section.
  3. Open your edited copy of testpage.html using a web browser of your choice.

After you launch the test page, you can simulate the submission of sensor data from multiple devices, as well as query the DynamoDB table for the historical data of a given device. In addition to using the test page to query DynamoDB, you can check the CloudWatch metrics published under the Sensor namespace.

Cleaning Up the Example Resources

To remove all resources created by this example, do the following:

  1. Delete all objects from the ArchiveBucket created by the CloudFormation stack.
  2. Delete the CloudFormation stack.
  3. Delete all CloudWatch log groups for each of the Lambda functions in the stack.
CloudFormation Template Resources

The following sections explain all of the resources created by the CloudFormation template provided with this example.

Lambda functions
Function roles
Event source mappings
IAM Users and Policies
Other Resources
Configuration
License

This reference architecture sample is licensed under Apache 2.0.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.