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
3.9k
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.1k
AWS CDK Conference Japan 2024 OP
tomoki10
0
560
TypeScripterに送るIaCの世界への招待〜AWS CDKと共に〜/inviting-typescripters-to-the-world-of-iac-with-aws-cdk
tomoki10
0
620
AWSでもBuildpacksを使ってDockerfileレスに出来るのか!?/can-i-use-buildpacks-to-go-dockerfile-less-in-aws
tomoki10
0
2.7k
ECS on Fargate のセキュリティ対策は何をやるべき?開発者目線で考える/security-for-ecs-on-fargate-secjawsdays
tomoki10
13
10k
AWS CDKの最強の書き方を実践してみる 2023年版/practice-the-strongest-writing-method-of-aws-cdk-2023-edition
tomoki10
4
6.5k
CDK支部のこれまでとこれから / jaws-ug-cdk-past-and-future
tomoki10
1
840
AWS CDKでECS on FargateのCI/CDを実現する際の理想と現実 / ideal-and-reality-when-implementing-cicd-for-ecs-on-fargate-with-aws-cdk
tomoki10
20
26k
AWSCDKを通してAWSを学ぶ/learn AWS through AWS CDK
tomoki10
0
3.3k
Other Decks in Technology
See All in Technology
Webセキュリティのあるきかた
akiym
30
9.2k
【shownet.conf_】コンピューティング資源を統合した分散コンテナ基盤の進化
shownet
PRO
0
380
テストコードの品質を客観的な数値で担保しよう〜Mutation Testのすすめ〜
ysknsid25
10
3k
【shownet.conf_】ネットワークテストの最適化と利便性の追求
shownet
PRO
0
320
入門 KRR
donkomura
0
110
小さな勉強会の始め方、広げ方、あるいは友達の作り方 / How to Start, Grow, and Build Connections with Small Study Groups
ar_tama
6
2.4k
過去のインプットとアウトプットを振り返る
diggymo
0
110
O'Reilly Superstream: Building a RAG App to Chat with Your Data
pamelafox
0
110
Oracle GoldenGate 23ai 導入Tips
oracle4engineer
PRO
1
260
Azure Verified Moduleを触って分かった注目ポイント/azure-verified-module-begin
mhrtech
1
350
山手線一周のパフォーマンス改善
suzukahr
0
150
【shownet.conf_】革新と伝統を融合したファシリティ
shownet
PRO
0
310
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.9k
Building an army of robots
kneath
302
42k
The Cost Of JavaScript in 2023
addyosmani
43
5.8k
Building Applications with DynamoDB
mza
90
6k
Speed Design
sergeychernyshev
22
470
It's Worth the Effort
3n
183
27k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Designing for humans not robots
tammielis
249
25k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
48k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Six Lessons from altMBA
skipperchong
26
3.4k
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 Ҏ֎ͰԠ༻Մೳ ɹ λΠϚʔॲཧ͕؆қʹ࣮Ͱ͖Δ