andrew warzon's presentation from aws chicago: "serverless iot deep dive"
TRANSCRIPT
Serverless IOTDeep Dive
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
Serverless == ?
@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
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
Your Inventory
@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...
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
Make Building Easier
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
Serverless Framework + IOT
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
IOT Event Support
@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
@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
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
Design Patterns
@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
@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
@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
@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" }
@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
@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
@2017 Trek10 – All Rights Reserved | 506 W. South St, South Bend, IN 46601 | [email protected] | (888) 736-2446 | www.trek10.com
Bonus Tips
@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
@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