© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
•
•
•
•
•
•
Unlimited Storage – Memory
Unlimited Compute – Logic
Cloud offers
Dr. Werner Vogels, Amazon.com CTO
re:Invent 2015 Keynote
COMPUTE
SERVICE
EVENT-
DRIVEN
AWS
Lambda
Application-tier at Scale
디바이스 SDK
클라이언트 인증 및 연결,
메시지 교환을 위한
개발도구
디바이스 게이트웨이
MQTT 및 HTTP 기반
디바이스 통신
보안 및 인증
고급 인증 및 암호화를
통한 보안 제공
RULES ENGINE
장치메시지를 규칙에 따라
AWS 서비스와 연계 동작
AWS 서비스
- - - - -
서드파티 서비스
DEVICE SHADOW
네트웍 단절에도 응답하는
가상 장치
애플리케이션
AWS IoT API
디바이스 레지스트리
IoT 장치 등록 및 관리
SubscribersPublishers
•
•
•
•
o
o
o
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["iot:Publish"],
"Resource":
["arn:aws:iot:us-east-1::topic/foo"]
},
{
"Effect": "Allow",
"Action": ["iot:Subscribe"],
"Resource":
["arn:aws:iot:us-east-
1::topicfilter/foo/bar/*"]
}]}
•
ü
ü
•
ü
ü
ü
ü
SELECT * FROM ‘things/thing-2/color’
WHERE color = ‘red’
{
"SELECT *, clientId() as MQTTClientId FROM 'room/ac/+'
WHERE temperature > 30",
"actions": [
{
”sns": {
"roleArn":
"arn:aws:iam::123456789012:role/SNSPutRole",
"topicArn": "arn:aws:sns:us-
east-1:123456789012:TempWarningNotification"
}
]
}
AWS Lambda 함수 실행
S3 버킷에 객체 저장
DynamoDB 테이블에 데이터
추가/변경
SNS 토픽으로 푸시 메시지
Amazon Kinesis 실시간 스트림
동작 실행
Amazon Kinesis Firehose 전달
AWS IoT에 전달
•
•
•
•
{
"state" : {
“desired" : {
"lights": { "color": "RED" },
"engine" : "ON"
},
"reported" : {
"lights" : { "color": "GREEN" },
"engine" : "ON"
},
"delta" : {
"lights" : { "color": "RED" }
}
},
"version" : 10
}
Thing
Mobile App
Shadow
•
•
•
•
•
•
desired: {
“status”: “RUNNING”
}
shadow/update update/accepted
Republish vacuum/shadow/update
vacuum/update/delta
reported: {
“AmbientLightValue”: 55
}
Rules Engine
Shadow
Shadow
Select * from $/update/accepted
where AmbientLightValue <100
C-SDK
(Ideal for embedded
OS)
JS-SDK
(Ideal for Embedded
Linux Platforms)
Arduino
Library
(Arduino Yun)
Mobile SDK
(Android and iOS)
ü
ü
AWS IoT
DynamoDB 테이블: 전체 센서 데이터 받는 경우
데이터 확인: 모든 센서 데이터를 다 받는 경우
AWS IoT
Amazon
CloudWatch
AWS
CloudFormation
Amazon
DynamoDB
Amazon
ElastiCache
Amazon
Aurora
IoT
shadow
Amazon API
GatewayAWS Lambda
Amazon
S3
Amazon
Kinesis
Amazon
SQS
Amazon
SNS
Amazon
Quick
sight
Amazon
Elastic
Search
Amazon
Machine
Learning
Amazon
Redshift
Mobile
Beacon
Amazon echo
Window sensorPower Plug
Switch
Bulb
Doorlock
Gateway
Boiler
Siren
Camera
Mobile
Beacon
API Gateway Lambda
AWS IoT
RDS SNS
S3DynamoDB
Certification Policy Shadow Rule Engine
Alexa Skills Kit – KOLON Home Service
Amazon echo
Users
Skill Information
publishingAmazon Alexa Skill : Home IoT In Mode
Alexa Skill Kit
Model
-intent
-utterance
PublishingLambda ARN
TEST Skill
// DEVELOPER CONSOLE
Lambda RDS
Device
Gateway
Device
Shadow
AWS IoT
Amazon echo
Users
Lambda
RDS
Device
Gateway
Device
Shadow
AWS IoT
Beacon
SELECT *
FROM '$aws/things/p100002201/shadow/update/accepted'
WHERE state.reported.detail.beacon_loc > 10
Rule Engine Query
Rule
Engine
Users
Lambda
RDS
SNS
S3
DynamoDB
Device
Gateway
Device
Shadow
AWS IoT
Mobile
API Gateway
PUT : ThingCtrl
PUT : SecurityMode
POST : SecurityMode Clear
PUT : OutMode
PUT : Inmode
Restful API
Rule
Engine
Door Sensor
def foo(input):
quux = bar(input.baz)
internalState.quux = quux
mysql_insert(quux)
def bar(input):
# do work
return result
Foo Bar
•
•
def handler(event, context):
quux = Lambda.Invoke(
'bar', event['baz'])
DynamoDB.PutItem(
'quux', quux)
def handler(event, context):
# do work
return result
Foo Bar
•
•
Monolithic/layered Microservices
•
•
•
App requests
over HTTPS
CRUD
operations
MQTT
CRUD
operations
MQTT
CloudWatch event
every 5 minutes
Lambda runs
for 5 minutes
Amazon
SQS queue
/register Check
cert
Robots to
register Queue
reader
Register
robot
Logging Lifecycle event
PermissionsCreate shadow
Dead letter queue
Robot
certificate
+ signed timestamp
CA certificate
Unauthenticated
HTTPS
Robot
certificate
Authenticated
MQTT
Request topic
Presigned URL
Symmetric
encryption key
Robot
public key
Response topic
Presigned URL
Object encrypted with
symmetric key
HTTPS call
to presigned URL
S3
KMS
Robot
certificate
S3
bucket
+
symmetric key
encrypted with
robot public key
Fleet of Sensors
OperatorAmazon
SNS
AWS
Lambda
AWS
IoT
AWS
Greengrass
Core
•
•
•
•
•
Amazon
DynamoDB
AWS
Lambda
Amazon
Redshift
https://aws.amazon.com/ko/serverless/ https://aws.amazon.com/ko/iot/
http://bit.ly/awskr-feedback

서버리스 IoT 백엔드 개발 및 구현 사례 : 윤석찬 (AWS 테크에반젤리스트)