andrew warzon's presentation from aws chicago: "serverless iot deep dive"

21
Serverless IOT Deep Dive

Upload: awschicago

Post on 11-Apr-2017

47 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

Serverless IOTDeep Dive

Page 2: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Serverless == ?

Page 3: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Let’s Get Building

Page 4: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Page 5: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Your Inventory

Page 6: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

AWS Platform (aka Serverless) Services

Step FunctionsDynamoDB StreamsAthenaSQS...

Page 7: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Make Building Easier

Page 8: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Serverless Framework + IOT

Page 9: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

IOT Event Support

Page 10: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Arbitrary CloudFormation in Serverless

Page 11: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Other Building Tips

● Offline Testing Not Really Possible

● Automated Testing for IOT Rules

● MQTT Client in AWS Console

Page 12: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Design Patterns

Page 13: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Components of an AWS IOT System

Control Plane● Thing Security● Thing Metadata● Provisioning● Claiming● Firmware

Updates

Data Ingestion

Data Storage

Data Processing API To Front End

Page 14: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Data Ingestion Options

$5/million messagesCheap, except when it’s not

Other options...

Kinesis StreamsKinesis Firehose

S3(When you have the resources on your thing…)

* Message size increment is a 512-byte block of data

DynamoDB

Page 15: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Queue at Serverless → Server-full Points

Bottleneck

Page 16: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Firmware Updates "firmware": { "version": "1.0.1", "urlForNewFirmware": "https://presignedS3URL" }

Page 17: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

More About Shadows

Data Flow

$aws/things/{ThingName}/shadow/update/accepted /update/rejected /update/delta /update/documents /get/accepted /get/rejected /delete/accepted /delete/rejected

MQTT or REST/update

/get/delete

Desired, Reported, & Delta States

{ "state": { "desired": { "color": "RED", "state": "STOP" }, "reported": { "color": "GREEN", "engine": "ON" }, "delta": { "color": "RED", "state": "STOP" } }}

MetadataVersioningTimestamps

Page 18: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Republish SQL

Sql: Fn::Sub: > SELECT get_thing_shadow(topic(3), '${GetThingRole.Arn}').state.reported.picturesTaken + 1 AS state.reported.picturesTaken FROM 'increment/picturesTaken/+' Actions: - Republish: Topic: $$aws/things/${topic(3)}/shadow/update RoleArn: { "Fn::GetAtt": [ "IAMRoleGetPublishThingShadow", "Arn" ]}

Device Updates Shadow

IOT SQL Manipulates

Shadow Data

IOT Republish Action Updates

Shadow

Page 19: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Bonus Tips

Page 20: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Bonus Tips

● Last Will & Testament

● Lifecycle Events

● CloudWatch Events

● Web Sockets

Page 21: Andrew Warzon's presentation from AWS Chicago: "Serverless IoT Deep Dive"

@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com

Thank You!

Andy WarzonTrek10

[email protected]