Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
IoT だけじゃない!? AWS IoT Events の真骨頂 / aws-iot-even...
Search
tomoki10
April 21, 2021
Technology
0
4k
IoT だけじゃない!? AWS IoT Events の真骨頂 / aws-iot-events-ones-true-value
AKIBA.AWS ONLINE #02 の登壇資料です。
https://dev.classmethod.jp/news/akiba-aws-210421/
tomoki10
April 21, 2021
Tweet
Share
More Decks by tomoki10
See All by tomoki10
Classmethod流のPlatform Engineering / classmethod-platform-engineering-devio2024
tomoki10
1
1.2k
AWS CDK Conference Japan 2024 OP
tomoki10
0
640
TypeScripterに送るIaCの世界への招待〜AWS CDKと共に〜/inviting-typescripters-to-the-world-of-iac-with-aws-cdk
tomoki10
0
700
AWSでもBuildpacksを使ってDockerfileレスに出来るのか!?/can-i-use-buildpacks-to-go-dockerfile-less-in-aws
tomoki10
0
2.8k
ECS on Fargate のセキュリティ対策は何をやるべき?開発者目線で考える/security-for-ecs-on-fargate-secjawsdays
tomoki10
14
11k
AWS CDKの最強の書き方を実践してみる 2023年版/practice-the-strongest-writing-method-of-aws-cdk-2023-edition
tomoki10
4
6.6k
CDK支部のこれまでとこれから / jaws-ug-cdk-past-and-future
tomoki10
1
860
AWS CDKでECS on FargateのCI/CDを実現する際の理想と現実 / ideal-and-reality-when-implementing-cicd-for-ecs-on-fargate-with-aws-cdk
tomoki10
21
26k
AWSCDKを通してAWSを学ぶ/learn AWS through AWS CDK
tomoki10
0
3.4k
Other Decks in Technology
See All in Technology
Mastering Quickfix
daisuzu
1
220
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
310
Chasing the White Whale of Open Source - ROI
mrbobbytables
0
100
複雑なState管理からの脱却
sansantech
PRO
1
160
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.4k
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
Next.jsとNuxtが混在? iframeでなんとかする!
ypresto
1
210
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
180
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
260
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
330
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Typedesign – Prime Four
hannesfritz
40
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Optimizing for Happiness
mojombo
376
70k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
GraphQLとの向き合い方2022年版
quramy
43
13k
RailsConf 2023
tenderlove
29
900
Code Reviewing Like a Champion
maltzj
520
39k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Being A Developer After 40
akosma
87
590k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Transcript
IoT ͚ͩ͡Όͳ͍!? AWS IoT Events ͷਅࠎ AKIBA.AWS ONLINE #02 2021/4/21
CXࣄۀຊ෦ ࠤ౻ஐथ 1
2 ࣗݾհ • ࠤ౻ஐथ • Ϋϥεϝιουגࣜձࣾ • CXࣄۀຊ෦ʢνʔϜIoTʣ • લ৬ɿSIerͷSEΛ4ऑ
• ݱࡏɿαʔόʔαΠυΤϯδχΞ • ͖ͳAWSαʔϏεɿLambdaɺCDK @tmk2154 @tomoki10
3 ͡Ίʹ IoT Events ͷ׆༻ IoT ʹͱͲ·Βͳ͍!? =>໊͚͋͑ͯ͢ΔͳΒ ɹ Serverless
Automaton
4 ରͷཧ ࢹௌऀͷΠϝʔδ • ͋Δఔ AWS ͍ͬͯΔɻLambdaͬͯΔ • IoT Events
΄΅Βͳ͍ɻ໊લฉ͍͔ͨΓ ඪ • IoT Events Λͬ͘͟Γཧղ͢Δ • ঢ়ଶཧλΠϚʔͷ࣮ʹ͑Δ͜ͱΛཧղ͢Δ
5 ֓ཁ • IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • IoT Events ͷར
• IoT Events ͱͦͷଞαʔϏεͱͷൺֱ
6 ֓ཁ • IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • IoT Events ͷར
• IoT Events ͱͦͷଞαʔϏεͱͷൺֱ
7 IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • ެࣜͷհ(αʔϏεϖʔδΑΓ) https://aws.amazon.com/jp/iot-events/
8 IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ ͳΔ΄Ͳ Θ͔ΒΜ
9 IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • ެࣜͷհ(Black Belt ΑΓ) https://www.slideshare.net/AmazonWebServicesJapan/20200916-aws-black-belt-online-seminar-aws-iot-events#12
10 IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • ެࣜͷհ(Black BeltΑΓ) https://www.slideshare.net/AmazonWebServicesJapan/20200916-aws-black-belt-online-seminar-aws-iot-events#16
• ެࣜͷհ(Black BeltΑΓ) 11 IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ https://www.slideshare.net/AmazonWebServicesJapan/20200916-aws-black-belt-online-seminar-aws-iot-events#16 ൣғ ൣғ֎
ਤ ɿσόΠε Ξϥʔτର
12 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ
13 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ભҠ݅ ঢ়ଶ AWS IoT Core IoT
rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ ։࢝Ґஔ
14 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ
15 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ
16 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ Amazon SNS
17 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ
18 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ
19 IoT Events ͷྲྀΕΛͬ͘͟Γղઆ ։࢝Ґஔ ભҠ݅ ঢ়ଶ AWS IoT Core
IoT rule IoT Device (GPS) AWS IoT Events ◦ ॲཧͷྲྀΕྫ GPSσʔλΛৗʹIoT Ruleʹૹ৴ ↓ ൣғ͔ભҠ݅ͰνΣοΫ ↓ ݅ద߹ʂΞΫγϣϯ࣮ߦ ↓ ঢ়ଶભҠ ͜ΜͳॲཧΛGUIͰ࡞ΕΔʂ ʢίʔυͰॻ͘͜ͱՄೳʣ
20 ֓ཁ • IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • IoT Events ͷར
• IoT Events ͱͦͷଞαʔϏεͱͷൺֱ
21 IoT αʔϏεͷಛੑ • σόΠε͕σʔλૹ৴ػೳ͚ͩͷ߹ଟ͍ • Ϋϥυଆ͔Β͢ΔͱΠϕϯτ͝ͱʹσʔλૹ৴ͯ͠ཉ͍͕͠ਨΕྲྀ͕͠ଟ͍ ΅͕͔͘Μ͕͍͖͑ͨ͞ΐ͏ͷIoTσόΠε Α͋͘ΔIoTσόΠε IoT
Device AWS IoT Core AWS Cloud Ξϥʔτൃੜʂ IoT Device AWS IoT Core AWS Cloud Թ:20 Թ:22 Թ:40 ٸʹԹมΘͬͨͳ Ξϥʔτʂʂ
22 IoT αʔϏεͷಛੑ • σόΠε͕σʔλऩूػೳ͚ͩͷ߹ଟ͍ • Ϋϥυଆ͔Β͢ΔͱΠϕϯτ͝ͱʹσʔλૹ৴ͯ͠ཉ͍͕͠ਨΕྲྀ͕͠ଟ͍ ΅͕͔͘Μ͕͍͖͑ͨ͞ΐ͏ͷIoTσόΠε Α͋͘ΔIoTσόΠε IoT
Device AWS IoT Core AWS Cloud Ξϥʔτൃੜʂ IoT Device AWS IoT Core AWS Cloud Թ:20 Թ:22 Թ:40 IoT Greengrass ͕͋ΕͰ͖ͦ͏ ͨͩσόΠεͷ੍͕…
23 IoT αʔϏεͷಛੑ • σόΠε͕σʔλऩूػೳ͚ͩͷ߹ଟ͍ • Ϋϥυଆ͔Β͢ΔͱΠϕϯτ͝ͱʹσʔλૹ৴ͯ͠ཉ͍͕͠ਨΕྲྀ͕͠ଟ͍ ΅͕͔͘Μ͕͍͖͑ͨ͞ΐ͏ͷIoTσόΠε Α͋͘ΔIoTσόΠε IoT
Device AWS IoT Core AWS Cloud Ξϥʔτൃੜʂ IoT Device AWS IoT Core AWS Cloud Թ:20 Թ:22 Թ:40 IoT EventsӈͷσόΠεͷ࣌ɺγϯϓϧʹঢ়ଶཧΛ࣮ݱͰ͖Δʂ
24 IoT Events ͕ͳ͍߹ͷઃܭྫ • ͏গ͠ৄࡉʹղઆ IoT Device (Թηϯαʔ) AWS
IoT Core AWS Cloud Թ:20 Թ:22 Թ:40 IoT rule AWS Lambda Amazon DynamoDB • ԹΛอଘ • ૹ৴͞ΕͨԹͱ લͷԹΛൺֱ • Թ͕ٸͳมԽͰ ΞϥʔτΛൃ๒ ΤϯυϙΠϯτ ঢ়ଶݕ ঢ়ଶอ࣋ AWS Lambda ΞΫγϣϯ Amazon SNS etc…
25 IoT Events ͕͋Δ߹ͷઃܭྫ • ͏গ͠ৄࡉʹղઆ IoT Device (Թηϯαʔ) AWS
IoT Core AWS Cloud Թ:20 Թ:22 Թ:40 IoT rule • ૹ৴͞ΕͨԹͱ લͷԹΛൺֱ • Թ͕ٸͳมԽͰ ΞϥʔτΛൃ๐ • ԹΛ෦ʹอଘ ΤϯυϙΠϯτ ঢ়ଶݕ ঢ়ଶอ࣋ AWS IoT Events AWS Lambda ΞΫγϣϯ Amazon SNS etc…
26 ઃܭ͕࣮ʹͳΔʢIaC ʹࠐՄ!ʣ ઃܭ࣮ͷΈ͔ผ్هࡌ͕ඞཁ IoT Events ͕ͳ͍߹ IoT Events ͕͋Δ߹
{ "detectorModelDefinition": { "states": [ { "stateName": "inBoundary", "onInput": { "events": [], "transitionEvents": [ JSON Export ઃܭอक͍͢͠
27 ֓ཁ • IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ • IoT Events ͷར
• IoT Events ͱͦͷଞαʔϏεͱͷൺֱ
Step Functions ͡ΌμϝͳΜʁ ͪΐͬͱͬͯ
ೖྗ͝ͱʹ։࢝εςʔτ͔ΒධՁ 29 ೖྗʹରͯ͠ݱࡏͷεςʔτ͔ΒධՁ Step Functions ͷ߹ IoT Events ͷ߹ AWS
IoT Core IoT rule AWS IoT Core IoT rule … Step Functions ͱͷൺֱ =>ঢ়ଶ͕ଟ͘ͳͬͨ߹ॲཧΛ͏ͷ͕େม => ಛఆͷঢ়ଶͱભҠ͚݅ͩ͑ॲཧ͕͔Δ
ೖྗ͝ͱʹ։࢝εςʔτ͔ΒධՁ 30 ೖྗʹରͯ͠ݱࡏͷεςʔτ͔ΒධՁ Step Functions ͷ߹ IoT Events ͷ߹ AWS
IoT Core IoT rule AWS IoT Core IoT rule … Step Functions ͱͷൺֱ =>ঢ়ଶ͕ଟ͘ͳͬͨ߹ॲཧΛ͏ͷ͕େม => ಛఆͷঢ়ଶͱભҠ͚݅ͩ͑ॲཧ͕͔Δ
31 ྫɽGANTZͷ಄ͷരػثͷ౪ݕΛ࣮͍ͯͩ͘͠͞ ɹɹ=> nҎ্ಛఆͷൣғ֎ʹ͍ͨ߹ঢ়ଶΛมߋ͍ͨ͠ IoT Events ͷ߹ => ҎԼͷΑ͏ʹλΠϚʔΛࠐΜ࣮͕ͩΈ͍͢ AWS
IoT Core IoT rule ①ಛఆͷൣғ͔Βग़ͨ߹ ɹ λΠϚʔελʔτ ②nҎʹൣғʹΕ ɹ λΠϚʔআ ③λΠϚʔ͕nΛա͗Ε ɹ ൣғ֎ͷঢ়ଶʹભҠ GPSσʔλΛৗʹૹ৴ ※IoT Events ͷλΠϚʔ1͕࠷খ୯Ґ 2021/4/18 ࣌ Step Functions ͱͷൺֱ
32 IoT Events ͱ༗ݶΦʔτϚτϯ • IoT Events ༗ݶΦʔτϚτϯͷ࣮ͱ͍͑Δ => ༗ݶΦʔτϚτϯ͕༗ޮͳ߹
IoT Ҏ֎Ͱద༻ՄೳͰ͋Δɻ => Serverless Ͱ͑ΔʢEC2ɺVPCෆཁʣ ɹ Ώ͑ʹ Serverless Automaton ͱݴ͑Δʂ https://ja.wikipedia.org/wiki/༗ݶΦʔτϚτϯ ༗ݶΦʔτϚτϯ IoT Events ͷ σΟςΫλʔϞσϧ
33 ϋʔτϏʔτࢹ => Ұఆ࣌ؒ௨৴ͷͳ͍߹Ξϥʔτ ͷੜ࢈ঢ়گࢹ => nҎ্ಛఆͷσʔλ͕དྷͨ࣌ΞΫγϣϯ࣮ߦ AWS IoT Core
IoT rule https://dev.classmethod.jp/articles/aws-iot-events-heartbeat/ σʔλ͕ج४Λ͑ͨΒ λΠϚʔελʔτ IoT Events ͷԠ༻ྫ Ұఆ࣌ؒج४Λ͑ͨΒ ঢ়ଶมߋ&ΞΫγϣϯ࣮ߦ
34 ·ͱΊ • IoT Events ͱԿ͕Ͱ͖ΔαʔϏεͳͷ͔ʁ => ঢ়ଶʹԠͨ͡ॲཧ͕Մೳ • IoT
Events ͷར => ঢ়ଶݕɺঢ়ଶཧΛDBɺLambdaͳ͠ͰՄೳ • IoT Events ͱͦͷଞαʔϏεͱͷൺֱ => ༗ݶΦʔτϚτϯ͕༗ޮͳ߹ʹ IoT Ҏ֎ͰԠ༻Մೳ ɹ λΠϚʔॲཧ͕؆қʹ࣮Ͱ͖Δ