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
0
740
AWS CDK Conference Japan 2024 OP
tomoki10
0
520
TypeScripterに送るIaCの世界への招待〜AWS CDKと共に〜/inviting-typescripters-to-the-world-of-iac-with-aws-cdk
tomoki10
0
590
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
9.8k
AWS CDKの最強の書き方を実践してみる 2023年版/practice-the-strongest-writing-method-of-aws-cdk-2023-edition
tomoki10
4
6.3k
CDK支部のこれまでとこれから / jaws-ug-cdk-past-and-future
tomoki10
1
830
AWS CDKでECS on FargateのCI/CDを実現する際の理想と現実 / ideal-and-reality-when-implementing-cicd-for-ecs-on-fargate-with-aws-cdk
tomoki10
19
25k
AWSCDKを通してAWSを学ぶ/learn AWS through AWS CDK
tomoki10
0
3.3k
Other Decks in Technology
See All in Technology
AWS版GitHub?Amazon CodeCatalystの全体像をまとめてみた
oshanqq
1
3.2k
Building Static Websites with Sculpin
opdavies
0
1.4k
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
39k
Estrategias de escalabilidade para projetos web
jessilyneh
1
150
Hyperledger Fabricの成長、成熟を振り返る / Looking back history of Hyperledger Fabric
gakumura
0
180
React Aria で実現する次世代のアクセシビリティ
ryo_manba
3
290
HolidayJp.jl を作りました
mrkn
0
110
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
0
3.1k
技術力あげたい
hisaichi5518
2
2.8k
バックログを導入し やっぱやめた話
ota42y
0
170
音声AIエージェントの世界とRetell AI入門 / Introduction to the World of Voice AI Agents and Retell AI
rkaga
3
470
EitherT_with_Future
aoiroaoino
0
380
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
96
10k
Code Reviewing Like a Champion
maltzj
518
39k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
34
1.9k
Code Review Best Practice
trishagee
62
16k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
42
2k
Why You Should Never Use an ORM
jnunemaker
PRO
53
8.9k
Music & Morning Musume
bryan
46
6k
The Pragmatic Product Professional
lauravandoore
30
6.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Six Lessons from altMBA
skipperchong
26
3.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
47k
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 Ҏ֎ͰԠ༻Մೳ ɹ λΠϚʔॲཧ͕؆қʹ࣮Ͱ͖Δ