SlideShare a Scribd company logo
AWS  IoT  &  GreenGrass
Chris  Munns  – Senior  Developer  Advocate  -­ munns@amazon.com
+
Andy,  Pat,  &  Nate  from  Solstice
AWS  New  York  City  Meetup
About  me:
Chris  Munns  -­ munns@amazon.com,  @chrismunns
– Senior  Developer  Advocate  -­ Serverless
– New  Yorker
– Previously:
• Business  Development  Manager  – DevOps,  July  ’15  -­ Feb  ‘17
• AWS  Solutions  Architect  Nov,  2011-­ Dec  2014
• Formerly  on  operations  teams  @Etsy  and  @Meetup
• Little  time  at  a  hedge  fund,  Xerox  and  a  few  other  startups
– Rochester  Institute  of  Technology:  Applied  Networking  and  
Systems  Administration  ’05
– Internet  infrastructure  geek
https://secure.flickr.com/photos/mgifford/4525333972
Why  are  we  
here  today?
25billion  devices  by  2020
Everyday  things  will  be  connected…
http://www.washingtonpost.com/sf/brand-­connect/wp-­content/uploads/sites/3/2015/05/cc_heroimage_v2.jpg
AWS NYC Meetup - May 2017 - "AWS IoT and Greengrass"
AWS NYC Meetup - May 2017 - "AWS IoT and Greengrass"
AWS NYC Meetup - May 2017 - "AWS IoT and Greengrass"
Mobile  =  IoT?    No…and  Yes.
Wearables Home  Automation  
Apps
Industrial  Control Equipment  
Companion  Apps
Connected  Device  &  Mobile  Apps  ßà Industrial  Devices  &  B2B  channels                    
IoT architectures  look  and  feel  different…
IoT architectures:
• Intermittent  network
• Devices  are  geo-­
dispersed
• Stateless  transactions
• No  IP
Web  architectures:
• Reliable  network
• Servers  aren’t  mobile
• Stateful transactions
• IP  address
AWS  IoT
DEVICE  SDK
Set  of  client  libraries  to  
connect,  authenticate  and  
exchange  messages
DEVICE  GATEWAY
Communicate  with  devices  via  
MQTT,  HTTP
and  Web  Sockets
AUTHENTICATION
AUTHORIZATION
Secure  with  mutual  
authentication  and  encryption
RULES  ENGINE
Transform  messages  
based  on  rules  and  
route  to  AWS  Services
AWS  Services
-­ -­ -­ -­ -­
3P  Services
DEVICE  SHADOW
Persistent  thing  state  
during  intermittent  
connections
APPLICATIONS
AWS  
IoT API
DEVICE  REGISTRY
Identity  and  Management  of  
your  things
MQTT  Primer
MQ  Telemetry  Transport  – the  IoT protocol
Ø Senders  ‘Publish’  to  topics  and  send  messages
Ø Receivers  ‘Subscribe’  to  topics  and  receive  messages
Ø All  subscribers  receive  all  messages  sent  to  a  topic
Ø Topic  names  can  be  subscribed  to  using  ‘wildcards’
topicname/path
Use  the  path  depth  
that  makes  sense  for  
your  application
MQTT  Primer
Pub: sensors/temp/room1
If  the  receiver  subscribes  to  the  
exact  full  path,  they  only  receive  
messages  sent  to  the  exact  full  path
All  messages  published  on  
this  topic  are  received  by  all  
subscribers  to  the  topic
Sub:    sensors/temp/room1
MQTT  Primer
Pub: sensors/temp/room1
The  plus  (+)  matches  exactly  one  
item  in  the  topic  hierarchy  so  here  
the  subscriber  will  receive
messages  for  all  sensors  in  room  1
All  messages  published  on  
this  topic  are  received  by  all  
subscribers  to  the  topic
Sub:    sensors/+/room1
Pub: sensors/temp/room1
The  Hash  (#)  means  the  subscriber  
will  receive  messages  for  all  
temperature  sensors  in  all  rooms
All  messages  published  on  
this  topic  are  received  by  all  
subscribers  to  the  topic
Sub:    sensors/temp/#
MQTT  Primer
AWS  IoT
DEVICE  SDK
Set  of  client  libraries  to  
connect,  authenticate  and  
exchange  messages
DEVICE  GATEWAY
Communicate  with  devices  via  
MQTT,  HTTP
and  Web  Sockets
AUTHENTICATION
AUTHORIZATION
Secure  with  mutual  
authentication  and  encryption
RULES  ENGINE
Transform  messages  
based  on  rules  and  
route  to  AWS  Services
AWS  Services
-­ -­ -­ -­ -­
3P  Services
DEVICE  SHADOW
Persistent  thing  state  
during  intermittent  
connections
APPLICATIONS
AWS  
IoT API
DEVICE  REGISTRY
Identity  and  Management  of  
your  things
AWS  IoT  Shadow
More  efficient  programming
Familiar  REST  APIs  for  read/write
Hide  complexity  of  device  connectivity  
(developers  do  not  need  to  know  what  
protocol  the  device  uses)
Mindful  of  device  constraints
Holds  the  commands  until  device  is  ready
Can  be  queried  in  lieu  of  the  device
Very  fast
Virtual  representation  of  the  device
Always  accessible  in  the  Cloud
Holds  “states”  up  to  1  year
Device  Shadow
• Plan  for  devices  to  lose  connectivity
– Device  may  need  to  shut  down  when  idle  to  conserve  battery.  
– Device  may  be  stable,  but  the  network  could  be  unreliable.
• Send  devices  commands  through  Shadows
– Instead  of  wrangling  custom  topics  and  keeping  state  yourself,  use  the  
Device  Shadow  to  abstract  away  the  topics  and  connectivity  issues.
• Query  device  state  through  Shadows
– The  Device  Shadow  is  always  available,  even  if  the  device  is  not.
• Addresses  message  ordering  for  command  and  control
– Uses  optimistic  locking  (version  number)  
Device  Shadow
Thing
reported  
state
desired  
state
MQTT
AWS  Lambda
The  device  itself  is  the  
source  of  truth  for  the  
‘reported’  state.  
Interested  parties  set  
the  ‘desired’  state  to  
request  a  change  to  the  
state  of  the  device.
• Used  to  request  a  change  to  device  state
Interested  parties  request  device  state  change  through  the  JSON  payload.
• Difference  between  ‘reported’  and  ‘desired’  
triggers  a  ‘delta’  message  to  the  device
The  AWS  IoT device  shadow  compares  the  ‘reported’  state  with  the  ‘desired’  state,  
and  any  properties  of  ‘desired’  not  present  or  different  in  the  ‘reported’  state  are  
notified  via  a  ‘delta’  message.
‘Desired’  state
AWS  IoT
DEVICE  SDK
Set  of  client  libraries  to  
connect,  authenticate  and  
exchange  messages
DEVICE  GATEWAY
Communicate  with  devices  via  
MQTT,  HTTP
and  Web  Sockets
AUTHENTICATION
AUTHORIZATION
Secure  with  mutual  
authentication  and  encryption
RULES  ENGINE
Transform  messages  
based  on  rules  and  
route  to  AWS  Services
AWS  Services
-­ -­ -­ -­ -­
3P  Services
DEVICE  SHADOW
Persistent  thing  state  
during  intermittent  
connections
APPLICATIONS
AWS  
IoT API
DEVICE  REGISTRY
Identity  and  Management  of  
your  things
AWS  IoT SDKs
• Supported  languages  /  environments
• Python
• Embedded  C
• iOS
• Android
• Javascript
• NodeJS
• Java
• Arduino  Yun
• Support  device  shadow  and  custom  topics
Built  on  top  of  Paho MQTT  client  library,  the  SDKs  abstract  
the  device  shadow  but  allow  direct  pub/sub
• Fully  documented
Rich  documentation  with  examples  on  GitHub
AWS  IoT – How  Do  You  Connect  a  Device?
1. Provision  a  certificate
AWS  IoT can  generate  the  Cert/Public/Private  keys  for  you
Alternatively,  BYO  certificate  to  more  easily  integrate  with  existing  workflows
2. Attach  an  IoT Policy
Associate  an  IoT Policy  document  with  the  certificate  to  scope  down  what  the  
certificate  holder  can  do
3. Connect  over  MQTT
Use  the  AWS  IoT SDKs  or  roll-­your-­own
4. Send  some  data
Publish  a  payload!
AWS  IoT
DEVICE  SDK
Set  of  client  libraries  to  
connect,  authenticate  and  
exchange  messages
DEVICE  GATEWAY
Communicate  with  devices  via  
MQTT,  HTTP
and  Web  Sockets
AUTHENTICATION
AUTHORIZATION
Secure  with  mutual  
authentication  and  encryption
RULES  ENGINE
Transform  messages  
based  on  rules  and  
route  to  AWS  Services
AWS  Services
-­ -­ -­ -­ -­
3P  Services
DEVICE  SHADOW
Persistent  thing  state  
during  intermittent  
connections
APPLICATIONS
AWS  
IoT API
DEVICE  REGISTRY
Identity  and  Management  of  
your  things
AWS  IoT – How  Do  You  Secure  Communications?
• Mutual  authentication  X.509  certificate-­based  auth
– When  devices  connect  to  the  AWS  IoT broker,  they  use  certificate-­based  
authentication.  You  assign  policies  to  certificates.
• AWS  SigV4
– When  browsers  use  WebSockets,  connections  are  signed  using  SigV4,  which  
identifies  the  user  principal  that  you  can  attach  AWS  IoT policies  to.
• Amazon  Cognito simplifies  signing  SigV4  requests
– Takes  care  of  steps  necessary  to  create  a  unique  identifier  for  users  and  
retrieve  temporary,  limited-­privilege  AWS  credentials.
AWS  IoT
DEVICE  SDK
Set  of  client  libraries  to  
connect,  authenticate  and  
exchange  messages
DEVICE  GATEWAY
Communicate  with  devices  via  
MQTT,  HTTP
and  Web  Sockets
AUTHENTICATION
AUTHORIZATION
Secure  with  mutual  
authentication  and  encryption
RULES  ENGINE
Transform  messages  
based  on  rules  and  
route  to  AWS  Services
AWS  Services
-­ -­ -­ -­ -­
3P  Services
DEVICE  SHADOW
Persistent  thing  state  
during  intermittent  
connections
APPLICATIONS
AWS  
IoT API
DEVICE  REGISTRY
Identity  and  Management  of  
your  things
Rules  Engine
• Easy  SQL-­Like  Syntax
• SELECT  attributes FROM  topic WHERE  
conditions,  IF  MATCH  THEN  action(s)
• Bring  Context
• From  Amazon  Machine  Learning,  IoT  
Shadows,  DDB
• Transforms  &  Enrich
• Math  library,  JSON  parsing  and  
cleansing  functions
• Route
• Send  to  10  AWS  Services  to  date  (Free)
• Multiple  Payload  format
• JSON  (including  nested  arrays)
• Binary
Rules  Engine
• Augment  or  filter  data  received  from  a  device.
• Write  data  received  to  an  Amazon  DynamoDB database.
• Save  a  file  to  Amazon  S3.
• Send  a  push  notification  to  all  users  of  Amazon  SNS.
• Publish  data  to  an  Amazon  SQS  queue.
• Invoke  a  Lambda  function  to  extract  data.
• Push  data  into  Elastic  Search.
• Process  messages  from  a  large  number
of  devices  using  Amazon  Kinesis.
• Republish  the  message  to  another  MQTT  topic.
Example  Rule
SELECT * FROM '#'
The  entire  contents
of  the  MQTT  message
All  messages  that  arrive  at  
the  message  broker
Example  Rule
SELECT * FROM
'$aws/things/SmartHub/shadow/update'
The  entire  contents
of  the  MQTT  message
Only  messages  as  part  of  a  
shadow  update  request
Example  Rule
SELECT state.reported.info as info
FROM '$aws/things/SmartHub/shadow/update'
WHERE state.reported.target="LightBulb"
Just  the  ‘info’  property  in  the  
reported  state  message
Only  messages  that  have  a  
‘target’  value  set  to  ‘LightBulb’
Demo:
Street  lighting  system
bit.ly/nycbulb01
Light  bulb  moment
Amazon  
CloudFront
Amazon  
S3  Bucket
AWS  IoT
IoT
shadow
Amazon
Cognito
Amazon
Cognito
Light  bulb  moment
AWS  IoT
Amazon
Cognito
IoT
shadow
AWS NYC Meetup - May 2017 - "AWS IoT and Greengrass"
Using  IoT Rules  to  republish  telemetry
AWS  IoT
IoT
shadowSensors
IoT
Rule
IoT
shadow
Local  
Lambda
Local
Device  Shadows
Local  
Security
Greengrass
is…
AWS
Local  
Broker
Why  Greengrass  is  important
Data  processed  
in  the  cloud
Data  
processed  
locally
Embedded
developer
Cloud
developer
Program  devices  with  
modern  languages,  
deployment  APIs,  and  
workflows
Cloud-­based  
development  that  adds  
value  to  data  that  never  
reach  the  cloud
Execute  code  locally  
in  response  to  data
Benefits  of  AWS  Greengrass
Respond to  local  events  quickly
Operate  offline
Simplified device  programming
Reduce the  cost  of  IoT  applications
Greengrass  Components
Greengrass  is  software,  not  
hardware  (you  bring  your  own)
2  Components  that  work  together:
• Greengrass  Core
• IoT Device  SDK
AWS  Greengrass  Core  (GGC)
The  runtime  responsible  for  
Lambda  execution,  messaging,  
device  shadows,  security,  and  for  
interacting  directly  with  the  cloud
AWS  Greengrass  Core  (GGC)
• Min  single-­core  1  GHz
• Min  128  MB  RAM
• x86  and  ARM
• Linux  (Ubuntu  or  Amazon)
• The  sky  is  the  limit
IoT device  SDK
Any  device  that  uses  the  IoT
device  SDK  can  be  configured  to  
interact  with  AWS  Greengrass  
core  via  the  local  network
Devices  can  be  small  or  big
Starts  with  the  IoT device  SDK  
for  C++,  more  coming  soon
Devices  work  together  locally
An  AWS  Greengrass  group  
is  a  set  of  cores  and  other  
devices  configured  to  
communicate  with  one  
another
Devices  work  together  with  the  cloud
AWS  Greengrass  works  
with  AWS  IoT  to  maintain  
long-­lived  connections  
and  process  data  via  
the  rules  engine
Your  Lambda  functions  
can  also  interact  directly  
with  other  AWS  services
AWS  Snowball  Edge
Petabyte-­scale  hybrid  device  with  onboard  compute  and  storage
• 100  TB  local  storage
• Local  compute  equivalent  to  an  Amazon  
EC2  m4.4xlarge  instance
• 10GBase-­T,  10/25Gb  SFP28,  and  40Gb  
QSFP+  copper,  and  optical  networking
• Ruggedized  and  rack-­mountable
RE:INVENT  2016  LAUNCH
Has  Greengrass  embedded!
How  to  get  started  today
Sign  up  for  limited  preview
http://aws.amazon.com/Greengrass
Demo:
Color  Cube  Demo
bit.ly/nyclight01
Customers  
Devices,  things  
and  data  sources
The  AWS  IOT  Platform AWS  Cloud  Services
The  AWS  IOT  Data  flow  model
Chris  Munns  
munns@amazon.com
@chrismunnshttps://www.flickr.com/photos/theredproject/3302110152/
?
https://secure.flickr.com/photos/dullhunk/202872717/

More Related Content

PPTX
Iot cloud service v2.0
PDF
Intro to AWS IoT - Pop-up Loft London
PDF
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
PPTX
Azure Internet of Things
PPTX
Architecting IoT solutions with Microsoft Azure
PPTX
Reply Bootcamp Rome - Mastering AWS - IoT Bootcamp
PPTX
Jeremy Cowan's AWS user group presentation "AWS Greengrass & IoT demo"
PDF
Connecting the Unconnected: IoT Made Simple
Iot cloud service v2.0
Intro to AWS IoT - Pop-up Loft London
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
Azure Internet of Things
Architecting IoT solutions with Microsoft Azure
Reply Bootcamp Rome - Mastering AWS - IoT Bootcamp
Jeremy Cowan's AWS user group presentation "AWS Greengrass & IoT demo"
Connecting the Unconnected: IoT Made Simple

Similar to AWS NYC Meetup - May 2017 - "AWS IoT and Greengrass" (13)

PDF
Workshop AWS IoT @ IoT World Paris
PDF
AWS Innovate: Building an Internet Connected Camera with AWS IoT- Tim Cruse
PDF
Internet der Ingenieure - reale und virtuelle Welten verschmelzen - AWS IoT W...
PDF
Workshop AWS IoT @ SIDO
PPTX
Unit 6.pptx
PDF
UNIT V.pdf
PDF
AWS IoT 및 Mobile Hub 서비스 소개 (김일호) :: re:Invent re:Cap Webinar 2015
PDF
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법 (김무현 솔루션즈 아키텍트)
PPTX
IoT Smart Home
PPTX
Creator IoT Framework
PPTX
Web + AWS + IoT, how to
PDF
Device Twins, Digital Twins and Device Shadow
PDF
AWS UG Indonesia Meetup - AWS IoT Core
Workshop AWS IoT @ IoT World Paris
AWS Innovate: Building an Internet Connected Camera with AWS IoT- Tim Cruse
Internet der Ingenieure - reale und virtuelle Welten verschmelzen - AWS IoT W...
Workshop AWS IoT @ SIDO
Unit 6.pptx
UNIT V.pdf
AWS IoT 및 Mobile Hub 서비스 소개 (김일호) :: re:Invent re:Cap Webinar 2015
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법 (김무현 솔루션즈 아키텍트)
IoT Smart Home
Creator IoT Framework
Web + AWS + IoT, how to
Device Twins, Digital Twins and Device Shadow
AWS UG Indonesia Meetup - AWS IoT Core
Ad

More from Chris Munns (14)

PDF
Building serverless applications with Amazon S3
PPTX
Networking Best Practices for Your Serverless Applications
PDF
How AWS builds Serverless services using Serverless
PDF
Serverless is dead.
PDF
All the Ops you need to know to Dev Serverless
PDF
Practical Guidance for Increasing your Serverless Application's Security
PPTX
Building API Driven Microservices
PPTX
The Future of API Management Is Serverless
PPTX
Serverless and DevOps
PPTX
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
PPTX
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
PPTX
Serverless Applications with AWS SAM
PPTX
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
PPTX
muCon 2017 - 12 Factor Serverless Applications
Building serverless applications with Amazon S3
Networking Best Practices for Your Serverless Applications
How AWS builds Serverless services using Serverless
Serverless is dead.
All the Ops you need to know to Dev Serverless
Practical Guidance for Increasing your Serverless Application's Security
Building API Driven Microservices
The Future of API Management Is Serverless
Serverless and DevOps
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
Serverless Applications with AWS SAM
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
muCon 2017 - 12 Factor Serverless Applications
Ad

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Modernizing your data center with Dell and AMD
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Modernizing your data center with Dell and AMD
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine learning based COVID-19 study performance prediction
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”

AWS NYC Meetup - May 2017 - "AWS IoT and Greengrass"

  • 1. AWS  IoT  &  GreenGrass Chris  Munns  – Senior  Developer  Advocate  -­ munns@amazon.com + Andy,  Pat,  &  Nate  from  Solstice AWS  New  York  City  Meetup
  • 2. About  me: Chris  Munns  -­ munns@amazon.com,  @chrismunns – Senior  Developer  Advocate  -­ Serverless – New  Yorker – Previously: • Business  Development  Manager  – DevOps,  July  ’15  -­ Feb  ‘17 • AWS  Solutions  Architect  Nov,  2011-­ Dec  2014 • Formerly  on  operations  teams  @Etsy  and  @Meetup • Little  time  at  a  hedge  fund,  Xerox  and  a  few  other  startups – Rochester  Institute  of  Technology:  Applied  Networking  and   Systems  Administration  ’05 – Internet  infrastructure  geek
  • 5. Everyday  things  will  be  connected… http://www.washingtonpost.com/sf/brand-­connect/wp-­content/uploads/sites/3/2015/05/cc_heroimage_v2.jpg
  • 9. Mobile  =  IoT?    No…and  Yes. Wearables Home  Automation   Apps Industrial  Control Equipment   Companion  Apps Connected  Device  &  Mobile  Apps  ßà Industrial  Devices  &  B2B  channels                    
  • 10. IoT architectures  look  and  feel  different… IoT architectures: • Intermittent  network • Devices  are  geo-­ dispersed • Stateless  transactions • No  IP Web  architectures: • Reliable  network • Servers  aren’t  mobile • Stateful transactions • IP  address
  • 11. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT,  HTTP and  Web  Sockets AUTHENTICATION AUTHORIZATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  Management  of   your  things
  • 12. MQTT  Primer MQ  Telemetry  Transport  – the  IoT protocol Ø Senders  ‘Publish’  to  topics  and  send  messages Ø Receivers  ‘Subscribe’  to  topics  and  receive  messages Ø All  subscribers  receive  all  messages  sent  to  a  topic Ø Topic  names  can  be  subscribed  to  using  ‘wildcards’ topicname/path Use  the  path  depth   that  makes  sense  for   your  application
  • 13. MQTT  Primer Pub: sensors/temp/room1 If  the  receiver  subscribes  to  the   exact  full  path,  they  only  receive   messages  sent  to  the  exact  full  path All  messages  published  on   this  topic  are  received  by  all   subscribers  to  the  topic Sub:    sensors/temp/room1
  • 14. MQTT  Primer Pub: sensors/temp/room1 The  plus  (+)  matches  exactly  one   item  in  the  topic  hierarchy  so  here   the  subscriber  will  receive messages  for  all  sensors  in  room  1 All  messages  published  on   this  topic  are  received  by  all   subscribers  to  the  topic Sub:    sensors/+/room1
  • 15. Pub: sensors/temp/room1 The  Hash  (#)  means  the  subscriber   will  receive  messages  for  all   temperature  sensors  in  all  rooms All  messages  published  on   this  topic  are  received  by  all   subscribers  to  the  topic Sub:    sensors/temp/# MQTT  Primer
  • 16. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT,  HTTP and  Web  Sockets AUTHENTICATION AUTHORIZATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  Management  of   your  things
  • 17. AWS  IoT  Shadow More  efficient  programming Familiar  REST  APIs  for  read/write Hide  complexity  of  device  connectivity   (developers  do  not  need  to  know  what   protocol  the  device  uses) Mindful  of  device  constraints Holds  the  commands  until  device  is  ready Can  be  queried  in  lieu  of  the  device Very  fast Virtual  representation  of  the  device Always  accessible  in  the  Cloud Holds  “states”  up  to  1  year
  • 18. Device  Shadow • Plan  for  devices  to  lose  connectivity – Device  may  need  to  shut  down  when  idle  to  conserve  battery.   – Device  may  be  stable,  but  the  network  could  be  unreliable. • Send  devices  commands  through  Shadows – Instead  of  wrangling  custom  topics  and  keeping  state  yourself,  use  the   Device  Shadow  to  abstract  away  the  topics  and  connectivity  issues. • Query  device  state  through  Shadows – The  Device  Shadow  is  always  available,  even  if  the  device  is  not. • Addresses  message  ordering  for  command  and  control – Uses  optimistic  locking  (version  number)  
  • 19. Device  Shadow Thing reported   state desired   state MQTT AWS  Lambda The  device  itself  is  the   source  of  truth  for  the   ‘reported’  state.   Interested  parties  set   the  ‘desired’  state  to   request  a  change  to  the   state  of  the  device.
  • 20. • Used  to  request  a  change  to  device  state Interested  parties  request  device  state  change  through  the  JSON  payload. • Difference  between  ‘reported’  and  ‘desired’   triggers  a  ‘delta’  message  to  the  device The  AWS  IoT device  shadow  compares  the  ‘reported’  state  with  the  ‘desired’  state,   and  any  properties  of  ‘desired’  not  present  or  different  in  the  ‘reported’  state  are   notified  via  a  ‘delta’  message. ‘Desired’  state
  • 21. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT,  HTTP and  Web  Sockets AUTHENTICATION AUTHORIZATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  Management  of   your  things
  • 22. AWS  IoT SDKs • Supported  languages  /  environments • Python • Embedded  C • iOS • Android • Javascript • NodeJS • Java • Arduino  Yun • Support  device  shadow  and  custom  topics Built  on  top  of  Paho MQTT  client  library,  the  SDKs  abstract   the  device  shadow  but  allow  direct  pub/sub • Fully  documented Rich  documentation  with  examples  on  GitHub
  • 23. AWS  IoT – How  Do  You  Connect  a  Device? 1. Provision  a  certificate AWS  IoT can  generate  the  Cert/Public/Private  keys  for  you Alternatively,  BYO  certificate  to  more  easily  integrate  with  existing  workflows 2. Attach  an  IoT Policy Associate  an  IoT Policy  document  with  the  certificate  to  scope  down  what  the   certificate  holder  can  do 3. Connect  over  MQTT Use  the  AWS  IoT SDKs  or  roll-­your-­own 4. Send  some  data Publish  a  payload!
  • 24. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT,  HTTP and  Web  Sockets AUTHENTICATION AUTHORIZATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  Management  of   your  things
  • 25. AWS  IoT – How  Do  You  Secure  Communications? • Mutual  authentication  X.509  certificate-­based  auth – When  devices  connect  to  the  AWS  IoT broker,  they  use  certificate-­based   authentication.  You  assign  policies  to  certificates. • AWS  SigV4 – When  browsers  use  WebSockets,  connections  are  signed  using  SigV4,  which   identifies  the  user  principal  that  you  can  attach  AWS  IoT policies  to. • Amazon  Cognito simplifies  signing  SigV4  requests – Takes  care  of  steps  necessary  to  create  a  unique  identifier  for  users  and   retrieve  temporary,  limited-­privilege  AWS  credentials.
  • 26. AWS  IoT DEVICE  SDK Set  of  client  libraries  to   connect,  authenticate  and   exchange  messages DEVICE  GATEWAY Communicate  with  devices  via   MQTT,  HTTP and  Web  Sockets AUTHENTICATION AUTHORIZATION Secure  with  mutual   authentication  and  encryption RULES  ENGINE Transform  messages   based  on  rules  and   route  to  AWS  Services AWS  Services -­ -­ -­ -­ -­ 3P  Services DEVICE  SHADOW Persistent  thing  state   during  intermittent   connections APPLICATIONS AWS   IoT API DEVICE  REGISTRY Identity  and  Management  of   your  things
  • 27. Rules  Engine • Easy  SQL-­Like  Syntax • SELECT  attributes FROM  topic WHERE   conditions,  IF  MATCH  THEN  action(s) • Bring  Context • From  Amazon  Machine  Learning,  IoT   Shadows,  DDB • Transforms  &  Enrich • Math  library,  JSON  parsing  and   cleansing  functions • Route • Send  to  10  AWS  Services  to  date  (Free) • Multiple  Payload  format • JSON  (including  nested  arrays) • Binary
  • 28. Rules  Engine • Augment  or  filter  data  received  from  a  device. • Write  data  received  to  an  Amazon  DynamoDB database. • Save  a  file  to  Amazon  S3. • Send  a  push  notification  to  all  users  of  Amazon  SNS. • Publish  data  to  an  Amazon  SQS  queue. • Invoke  a  Lambda  function  to  extract  data. • Push  data  into  Elastic  Search. • Process  messages  from  a  large  number of  devices  using  Amazon  Kinesis. • Republish  the  message  to  another  MQTT  topic.
  • 29. Example  Rule SELECT * FROM '#' The  entire  contents of  the  MQTT  message All  messages  that  arrive  at   the  message  broker
  • 30. Example  Rule SELECT * FROM '$aws/things/SmartHub/shadow/update' The  entire  contents of  the  MQTT  message Only  messages  as  part  of  a   shadow  update  request
  • 31. Example  Rule SELECT state.reported.info as info FROM '$aws/things/SmartHub/shadow/update' WHERE state.reported.target="LightBulb" Just  the  ‘info’  property  in  the   reported  state  message Only  messages  that  have  a   ‘target’  value  set  to  ‘LightBulb’
  • 34. Light  bulb  moment Amazon   CloudFront Amazon   S3  Bucket AWS  IoT IoT shadow Amazon Cognito Amazon Cognito
  • 35. Light  bulb  moment AWS  IoT Amazon Cognito IoT shadow
  • 37. Using  IoT Rules  to  republish  telemetry AWS  IoT IoT shadowSensors IoT Rule IoT shadow
  • 38. Local   Lambda Local Device  Shadows Local   Security Greengrass is… AWS Local   Broker
  • 39. Why  Greengrass  is  important Data  processed   in  the  cloud Data   processed   locally Embedded developer Cloud developer Program  devices  with   modern  languages,   deployment  APIs,  and   workflows Cloud-­based   development  that  adds   value  to  data  that  never   reach  the  cloud Execute  code  locally   in  response  to  data
  • 40. Benefits  of  AWS  Greengrass Respond to  local  events  quickly Operate  offline Simplified device  programming Reduce the  cost  of  IoT  applications
  • 41. Greengrass  Components Greengrass  is  software,  not   hardware  (you  bring  your  own) 2  Components  that  work  together: • Greengrass  Core • IoT Device  SDK
  • 42. AWS  Greengrass  Core  (GGC) The  runtime  responsible  for   Lambda  execution,  messaging,   device  shadows,  security,  and  for   interacting  directly  with  the  cloud
  • 43. AWS  Greengrass  Core  (GGC) • Min  single-­core  1  GHz • Min  128  MB  RAM • x86  and  ARM • Linux  (Ubuntu  or  Amazon) • The  sky  is  the  limit
  • 44. IoT device  SDK Any  device  that  uses  the  IoT device  SDK  can  be  configured  to   interact  with  AWS  Greengrass   core  via  the  local  network Devices  can  be  small  or  big Starts  with  the  IoT device  SDK   for  C++,  more  coming  soon
  • 45. Devices  work  together  locally An  AWS  Greengrass  group   is  a  set  of  cores  and  other   devices  configured  to   communicate  with  one   another
  • 46. Devices  work  together  with  the  cloud AWS  Greengrass  works   with  AWS  IoT  to  maintain   long-­lived  connections   and  process  data  via   the  rules  engine Your  Lambda  functions   can  also  interact  directly   with  other  AWS  services
  • 47. AWS  Snowball  Edge Petabyte-­scale  hybrid  device  with  onboard  compute  and  storage • 100  TB  local  storage • Local  compute  equivalent  to  an  Amazon   EC2  m4.4xlarge  instance • 10GBase-­T,  10/25Gb  SFP28,  and  40Gb   QSFP+  copper,  and  optical  networking • Ruggedized  and  rack-­mountable RE:INVENT  2016  LAUNCH Has  Greengrass  embedded!
  • 48. How  to  get  started  today Sign  up  for  limited  preview http://aws.amazon.com/Greengrass
  • 50. Customers   Devices,  things   and  data  sources The  AWS  IOT  Platform AWS  Cloud  Services The  AWS  IOT  Data  flow  model