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
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
230
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
500
re:Invent2024のIaC周りのアップデート&セッションの共有/around-re-invent-2024-iac-updates
tomoki10
0
1k
Classmethod流のPlatform Engineering / classmethod-platform-engineering-devio2024
tomoki10
1
1.3k
AWS CDK Conference Japan 2024 OP
tomoki10
0
700
TypeScripterに送るIaCの世界への招待〜AWS CDKと共に〜/inviting-typescripters-to-the-world-of-iac-with-aws-cdk
tomoki10
0
740
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.7k
Other Decks in Technology
See All in Technology
Server-Side Engineer of LINE Sukimani
lycorp_recruit_jp
0
340
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
27
23k
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
540
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
150
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.6k
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
280
AWS環境におけるランサムウェア攻撃対策の設計
nrinetcom
PRO
0
140
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
670
型情報を用いたLintでコード品質を向上させる
sansantech
PRO
2
130
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
230
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
320
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
160
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Git: the NoSQL Database
bkeepers
PRO
427
64k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Producing Creativity
orderedlist
PRO
342
39k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How STYLIGHT went responsive
nonsquared
96
5.2k
Practical Orchestrator
shlominoach
186
10k
Scaling GitHub
holman
459
140k
GitHub's CSS Performance
jonrohan
1031
460k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Code Reviewing Like a Champion
maltzj
521
39k
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 Ҏ֎ͰԠ༻Մೳ ɹ λΠϚʔॲཧ͕؆қʹ࣮Ͱ͖Δ