cloud tutorial: aws iot - cse.wustl.edulu/cse521s/slides/aws-iot.pdf · cloud tutorial: aws iot ta...
TRANSCRIPT
![Page 1: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/1.jpg)
CloudTutorial:AWSIoT
TAforclassCSE521S,Fall,Jan/18/2018HaoranLi
![Page 2: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/2.jpg)
Pointers
Ø Amazon IoTq http://docs.aws.amazon.com/iot/latest/developerguide/what-is-
aws-iot.html
Ø Amazon EC2q http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
EC2_GetStarted.html
Ø Resource list for course projectsq http://cps.cse.wustl.edu/index.php/List_of_Projects
Ø Apply for $40 credits for Amazon AWS q https://aws.amazon.com/education/awseducate/apply/
2
![Page 3: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/3.jpg)
XaaS:BasicsinCloudComputing
![Page 4: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/4.jpg)
CloudComputing
1/18/18 4
Ø Cloud computing provides shared pool of configurable computing resource to end users on demand
Ø Three service modelsq IaaS (Infrastructure as a Service): virtual machines, storage,
network …q PaaS (Platform as a Service): execution runtime, middleware,
web server, database, development tool …q SaaS (Software as a Service): email, virtual desktop, games …
![Page 5: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/5.jpg)
CloudServices:On-premiseSoftware
Ø Traditional
Ø installed and runs on personal computer
Ø You Manage and Deployq Hardwareq OSq Software
Ø Exampleq This presentation
1/18/18 5
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
YouManage
![Page 6: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/6.jpg)
InfrastructureasaService(IaaS)Ø IaaS
q "physical server box”q Virtual Machine
• Memory• Storage• CPU• Network
Ø Exampleq AWS EC2q AWS HPC
Ø Usecaseq Build up you VM cluster
1/18/18 6
YouManage
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
ServiceProviderManages
WebService
![Page 7: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/7.jpg)
PlatformasaService(PaaS)
Ø PaaSq You get a framework
q Host Application
q Tools
Ø Exampleq AWS IoT
Ø Usecaseq Build up you’re smart A/C
controller
1/18/18 7
YouManage
ServiceProviderManages
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
![Page 8: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/8.jpg)
PaaSExample:AmazonIoT
1/18/18 8
Tools
Framework
![Page 9: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/9.jpg)
SoftwareasaService(SaaS)
Ø SaaSq You get a whole solution
Ø Exampleq Gmailq Dropbox
q Office365
1/18/18 9
ServiceProviderManages
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
![Page 10: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/10.jpg)
XaaS:ARecap
1/18/18 10
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
YouManage
YouManage
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
ServiceProviderManages
YouManage
ServiceProviderManages
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
ServiceProviderManages
APP
Data
Runtime
Middleware
OS
Virtualization
Server
Storage
Network
On-Premise IaaS PaaS SaaS
![Page 11: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/11.jpg)
Tutorial:Hello!AWSIoT!!
![Page 12: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/12.jpg)
Internet-of-Things
1/18/18 12
Ø Things (Devices)q Many of them• Different Types
• Isolated Systems
q Data and Command• Sensing the world
• Give Response
q Challenge• United: Connected + Communication
• Smart: Data Analytics + Strategy
Source:https://aws.amazon.com/iot-platform/http://www.brain-smart.net/smart-brain-health-blog/page/2/#axzz4W4oSp8a6
![Page 13: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/13.jpg)
Solution:AWSIoT
1/18/18 13
United:Connect+Communication Smart:OtherCloudServiceDataStorageMachineLearning
Source:https://aws.amazon.com/iot-platform/
Stated:“ThingShadow”
![Page 14: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/14.jpg)
Tutorial:HelloAWSIoT!
1/18/18 14Source:https://aws.amazon.com/iot-platform/
RandomInteger[1,100]
Publish
AmazonSNS
Forward
AWSEC2t2.micro
Subscribe
![Page 15: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/15.jpg)
Step1:CreateaVirtual"Thing”
1/18/18 15
AWSIoT
Virtual“Thing”/Shadow
![Page 16: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/16.jpg)
GetintoAWSManageConsole
Ø Create your own AWS accountØ Sign In IoT Manage Console
q https://aws.amazon.com/iot/
1/18/18 16
![Page 17: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/17.jpg)
Createathing
Ø 1. AWS IoT Menuq Registry
• Things è Create
Ø 2. Give a name
1/18/18 17
![Page 18: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/18.jpg)
BasicInteract:Publish
Ø Using Embedded MQTT Client to Test
Ø Check the Things Shadow
1/18/18 18
![Page 19: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/19.jpg)
BasicInteract:Subscribe
1/18/18 19
![Page 20: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/20.jpg)
AWSEC2t2.micro
Step2:Connecta“Physical”Device
1/18/18 20
AWSIoT
Virtual“Thing”/Shadow
Attach
Certificate
Policy Copy
MQTTClient
RandomInteger[1,100]
![Page 21: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/21.jpg)
CreateandgetCertificates
Ø Create Certificatesq Security è Certificates è Create
Ø Download Cert Files• 1. public & private key• 2. thing cert
• 3. Root CA for AWS
1/18/18 21
![Page 22: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/22.jpg)
CreatePolicyandattachittocert
Ø Create Policy
Ø Attach Policy to Certificates
1/18/18 22
Setyourpolicytoallowpub/sub!
![Page 23: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/23.jpg)
ConnectyourDevice
Ø Copy certificates to your EC2 Instanceq Note: through scp utility
Ø Choose your AWS SDK (support MQTT)q Node JS
q Pythonq Java
Ø You can also use third party MQTT toolsq Python (paho-mqtt library)
1/18/18 23
![Page 24: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/24.jpg)
SomeNotes
Ø 1. You will need these certification when setting up the TLS1.2 verification
Ø 2. You will need the endpoint and port (8883) when connect to AWS IoT Gateway
1/18/18 24
![Page 25: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/25.jpg)
More:RuleEngine,LinkwithSNSservices
Ø Simple Notification Service
1/18/18 25
Publish
AmazonSNS
AWSIoT
Virtual“Thing”/Shadow
Forward
Topic:CSE521_Tutorial
Subscribe
Subscribe
AWSEC2t2.micro
![Page 26: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/26.jpg)
AmazonSNS
Ø Create a Topicq ARN will be used
later
Ø Subscribe your cellphone and email to this topic
1/18/18 26
![Page 27: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/27.jpg)
CreateaRuleinAmazonIoT
Ø Add a query to filter your inteseting topic (event)
Ø Add an Action:q Forward this message to SNSq Specify Dest ARN
q Enable Rule
1/18/18 27
![Page 28: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/28.jpg)
NotificationonSMS&Email
1/18/18 28
![Page 29: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/29.jpg)
OneMoreThing:AccountSecurity
Ø DON’T UPLOAD YOUR KEY PUBLICLY!!!
1/18/18 29
TimetoOpenSource!
Source:WeChatSubscriptions: 西乔《神秘的程序员们 39》GeekLifeChpt39.
![Page 30: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/30.jpg)
Whatif…$50,000AWSBill!
1/18/18 30Source:https://www.quora.com/My-AWS-account-was-hacked-and-I-have-a-50-000-bill-how-can-I-reduce-the-amount-I-need-to-pay
![Page 31: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/31.jpg)
Pointers
Ø Amazon EC2q http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
EC2_GetStarted.html
Ø Amazon IoTq http://docs.aws.amazon.com/iot/latest/developerguide/what-is-
aws-iot.html
Ø Resource list for course projectsq http://cps.cse.wustl.edu/index.php/List_of_Projects
Ø Apply for $40 credits for Amazon AWS q https://aws.amazon.com/education/awseducate/apply/
31
![Page 32: Cloud Tutorial: AWS IoT - cse.wustl.edulu/cse521s/Slides/aws-iot.pdf · Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li](https://reader030.vdocuments.net/reader030/viewer/2022021520/5b74959f7f8b9ac94a8c372e/html5/thumbnails/32.jpg)
Thanks!
HaoranLi
Jan/18/2018