Cloud Tutorial: AWS IoT TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li
Pointers Ø Amazon IoT q http://docs.aws.amazon.com/iot/latest/developerguide/what-isaws-iot.html Ø Amazon EC2 q http://docs.aws.amazon.com/awsec2/latest/userguide/ EC2_GetStarted.html Ø Resource list for course projects q 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
XaaS: Basics in Cloud Computing
Cloud Computing Ø Cloud computing provides shared pool of configurable computing resource to end users on demand Ø Three service models q 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 1/18/18 4
Cloud Services: On-premise Software Ø Traditional Ø installed and runs on personal computer Ø You Manage and Deploy q Hardware q OS q Software Ø Example q This presentation APP Data Runtime Middleware OS Virtualization Server Storage Network You Manage 1/18/18 5
Infrastructure as a Service (IaaS) Ø IaaS q "physical server box q Virtual Machine Memory Storage CPU Network Web Service APP Data Runtime Middleware You Manage Ø Example q AWS EC2 q AWS HPC Ø Usecase q Build up you VM cluster OS Virtualization Server Storage Network Service Provider Manages 1/18/18 6
Platform as a Service (PaaS) Ø PaaS q You get a framework q Host Application q Tools Ø Example q AWS IoT Ø Usecase q Build up you re smart A/C controller APP Data Runtime Middleware OS Virtualization Server Storage Network You Manage Service Provider Manages 1/18/18 7
PaaS Example: Amazon IoT Tools Framework 1/18/18 8
Software as a Service (SaaS) Ø SaaS q You get a whole solution Ø Example q Gmail q Dropbox q Office365 APP Data Runtime Middleware OS Virtualization Server Service Provider Manages Storage Network 1/18/18 9
XaaS: A Recap On-Premise IaaS PaaS SaaS APP Data Runtime Middleware OS Virtualization Server Storage Network You Manage APP Data Runtime Middleware OS Virtualization Server Storage Network You Manage Service Provider Manages APP Data Runtime Middleware OS Virtualization Server Storage Network 1/18/18 10 You Manage Service Provider Manages APP Data Runtime Middleware OS Virtualization Server Storage Network Service Provider Manages
Tutorial: Hello! AWS IoT!!
Internet-of-Things Ø 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 1/18/18 Source: https://aws.amazon.com/iot-platform/ 12 http://www.brain-smart.net/smart-brain-health-blog/page/2/#axzz4w4osp8a6
Solution: AWS IoT United: Connect + Communication Stated: Thing Shadow Smart: Other Cloud Service Data Storage Machine Learning 1/18/18 Source: https://aws.amazon.com/iot-platform/ 13
Tutorial: Hello AWS IoT! Random Integer [1, 100] Publish Forward EC2 t2.micro AWS Subscribe Amazon SNS 1/18/18 Source: https://aws.amazon.com/iot-platform/ 14
Step 1: Create a Virtual "Thing AWS IoT Virtual Thing / Shadow 1/18/18 15
Get into AWS Manage Console Ø Create your own AWS account Ø Sign In IoT Manage Console q https://aws.amazon.com/iot/ 1/18/18 16
Create a thing Ø 1. AWS IoT Menu q Registry Things è Create Ø 2. Give a name 1/18/18 17
Basic Interact: Publish Ø Using Embedded MQTT Client to Test Ø Check the Things Shadow 1/18/18 18
Basic Interact: Subscribe 1/18/18 19
Step 2: Connect a Physical Device Random Integer [1, 100] MQTT Client AWS IoT Virtual Thing / Shadow Attach Certificate EC2 t2.micro AWS Copy Policy 1/18/18 20
Create and get Certificates Ø Create Certificates q Security è Certificates è Create Ø Download Cert Files 1. public & private key 2. thing cert 3. Root CA for AWS 1/18/18 21
Create Policy and attach it to cert Ø Create Policy Ø Attach Policy to Certificates Set your policy to allow pub/sub! 1/18/18 22
Connect your Device Ø Copy certificates to your EC2 Instance q Note: through scp utility Ø Choose your AWS SDK (support MQTT) q Node JS q Python q Java Ø You can also use third party MQTT tools q Python (paho-mqtt library) 1/18/18 23
Some Notes Ø 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
More: Rule Engine, Link with SNS services Ø Simple Notification Service AWS IoT EC2 t2.micro AWS Publish Virtual Thing / Shadow Forward Subscribe Topic: CSE521_Tutorial Subscribe Amazon SNS 1/18/18 25
Amazon SNS Ø Create a Topic q ARN will be used later Ø Subscribe your cellphone and email to this topic 1/18/18 26
Create a Rule in Amazon IoT Ø Add a query to filter your inteseting topic (event) Ø Add an Action: q Forward this message to SNS q Specify Dest ARN q Enable Rule 1/18/18 27
Notification on SMS & Email 1/18/18 28
One More Thing: Account Security Ø DON T UPLOAD YOUR KEY PUBLICLY!!! Time to Open Source! 1/18/18 29 Source: WeChat Subscriptions: 西乔 神秘的程序员们 39 Geek Life Chpt 39.
What if $50,000 AWS Bill! 1/18/18 30 Source: 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
Pointers Ø Amazon EC2 q http://docs.aws.amazon.com/awsec2/latest/userguide/ EC2_GetStarted.html Ø Amazon IoT q http://docs.aws.amazon.com/iot/latest/developerguide/what-isaws-iot.html Ø Resource list for course projects q 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
Thanks! Haoran Li Jan/18/2018