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
AWS x Alexa対策講座
Search
chao2suke
August 21, 2018
Technology
1
710
AWS x Alexa対策講座
2018/08/21 Alexa Salon SP@東京 資料
chao2suke
August 21, 2018
Tweet
Share
More Decks by chao2suke
See All by chao2suke
天井カメラで捉えた人物をコンピュータビジョンで解析した3年間のトライアンドエラーとこれから
chao2suke
0
2.3k
結局普通のエンジニアが今SageMaker使うと何ができるのかわかるLT
chao2suke
0
1.7k
機械学習の知識ゼロでも動かせるAIツールキットの世界
chao2suke
0
1.7k
「今」のAI技術と「3年後」のAI技術のご紹介
chao2suke
0
1.1k
Alexaに詳しい人は普段Alexaをどう扱っているか
chao2suke
0
900
奥深きAPLの世界
chao2suke
0
120
Alexaスキル & レジレスCafeにおけるStripe活用の取り組み
chao2suke
0
2k
Alexa x 機械学習でスキルをよりリッチにする方法
chao2suke
0
1.7k
#AAJUG vol.2 APL ハンズオン
chao2suke
0
2.8k
Other Decks in Technology
See All in Technology
AIの全社活用を推進するための安全なレールを敷いた話
shoheimitani
2
560
20250705 Headlamp: 專注可擴展性的 Kubernetes 用戶界面
pichuang
0
290
american airlines®️ USA Contact Numbers: Complete 2025 Support Guide
supportflight
1
110
衛星運用をソフトウェアエンジニアに依頼したときにできあがるもの
sankichi92
1
160
AWS CDK 入門ガイド これだけは知っておきたいヒント集
anank
3
290
SEQUENCE object comparison - db tech showcase 2025 LT2
nori_shinoda
0
160
united airlines ™®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedhelp
1
440
MobileActOsaka_250704.pdf
akaitadaaki
0
170
Delta airlines Customer®️ USA Contact Numbers: Complete 2025 Support Guide
deltahelp
0
930
Getting to Know Your Legacy (System) with AI-Driven Software Archeology (WeAreDevelopers World Congress 2025)
feststelltaste
1
160
CDKTFについてざっくり理解する!!~CloudFormationからCDKTFへ変換するツールも作ってみた~
masakiokuda
1
180
NewSQLや分散データベースを支えるRaftの仕組み - 仕組みを理解して知る得意不得意
hacomono
PRO
3
190
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
980
The World Runs on Bad Software
bkeepers
PRO
69
11k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Unsuck your backbone
ammeep
671
58k
Automating Front-end Workflow
addyosmani
1370
200k
Side Projects
sachag
455
42k
Fireside Chat
paigeccino
37
3.5k
Adopting Sorbet at Scale
ufuk
77
9.5k
Gamification - CAS2011
davidbonilla
81
5.4k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Transcript
AWS x Alexa ରࡦߨ࠲ クラスメソッド株式会社 せーの 1
ࣗݾհ ✦ ਗ਼ɹ߶࢙(ͤʔͷ) ✦ ΫϥεϝιουגࣜձࣾࡳຈΦϑΟε AIιϦϡʔγϣϯ෦ AlexaςΫχΧϧΤόϯδΣϦετ VUIΞʔΩςΫτ 2
Agenda ✦ جຊͱͯ͠ԡ͓͑ͯ͘͞αʔϏε ✦ AWS IAM ✦ DynamoDB ✦ Cognito
✦ AlexaͷදݱྗΛิ͏ ✦ AWS IoT ✦ Kinesis Video Stream + Rekognition Video ✦ ӡ༻Λॿ͚Δ ✦ CloudWatch Logs ✦ API Gateway 3
4 AWS IAM
5 AWS IAM ✦ ֤AWS αʔϏεͷ༻ݖݶΛ੍ޚ͢Δ ✦ ʮϢʔβʔʯ͕αʔϏεΛ͑Δ => IAM
User ✦ ʮαʔϏεΛ͑ΔݖݶʯΛ ͍Ζ͍Ζͳͷʹ͚ͭΔ => IAM Role ✦ LambdaͷτϦΨʔ͔Β֬ೝͰ͖Δ
6 AWS IAM
7 AWS IAM
8 AWS IAM
9 DynamoDB
10 DynamoDB ✦ NoSQLܗࣜͷσʔλϕʔεαʔϏε ✦ αʔόʔεϖοΫ༰ྔؾʹ͠ͳͯ͘ྑ͍ ʢϚωʔδυαʔϏε) ✦ ӬଓԽαʔϏεͱͯ͠Alexa-SDKʹσϑΥϧτ Ͱૢ࡞API͕͍͍ͭͯΔ
✦ ॳ৺ऀ͕Ҿ͔͔ͬΔͷʮΩʔʯͱʮϢχοτʯ
11 DynamoDB var alexa = Alexa.handler(event, context); alexa.dynamoDBTableName = 'AlexaUserData_V1';
12 DynamoDB Alexa.SkillBuilders.standard() .addRequestHandlers(LaunchRequestHandler) .withTableName("AlexaUserData_V2") .withAutoCreateTable(true) .lambda();
13 DynamoDB handlerInput.attributesManager.setPersistentAttributes(dynamos) ; await handlerInput.attributesManager.savePersistentAttributes();
14 DynamoDB Ωʔ / ΠϯσοΫεͷ͍͍ͭͯΔItem͕ݕࡧͰ͖Δ
15 DynamoDB ϓϥΠϚϦΩʔ Hash Key Range Key Hash Key OR
16 DynamoDB ηΧϯμϦΠϯσοΫε Hash Key Range Key Hash Key Local
Secondary Index Range Key Global Secondary Index
17 DynamoDB ΩϟύγςΟʔϢχοτ
18 DynamoDB ΩϟύγςΟʔϢχοτ WCU (Write Capacity Unit) RCU (Read Capacity
Unit)
19 DynamoDB ΩϟύγςΟʔϢχοτ WCU (Write Capacity Unit) RCU (Read Capacity
Unit) 1 4KB 1 2 1 1KB 1
20 DynamoDB DynamoDBͷಡΈࠐΈ GetItem BatchGetItem Query Scan
21 DynamoDB
22 DynamoDB ಡΈࠐΈ༰ྔ +
23 DynamoDB
24 Cognito
25 Cognito ✦ AWSͷೝূαʔϏε ✦ Facebook / Google / Amazon
Login / TwitterʹରԠ ✦ ಠࣗͷೝূج൫ʮCognito User Poolʯ Λ࡞Ͱ͖Δ =>AlexaʹखܰͳೝূΛ͚ͭΒΕΔ
26 Cognito Device ID ✦ Device IDεΩϧͷOFF/ONͰมΘΔ ✦ εΩϧԻͰOFF/ON͕Ͱ͖Δ ✦
Alexa݁ߏޡೝࣝ͢Δ ✦ Βͳ͍ؒʹͯ͢ͷDeviceID͕มΘ͍ͬͯΔ ͜ͱ͕͋Δ
27 Cognito https://bit.ly/2whJEZJ
Agenda ✦ جຊͱͯ͠ԡ͓͑ͯ͘͞αʔϏε ✦ AWS IAM ✦ DynamoDB ✦ Cognito
✦ AlexaͷදݱྗΛิ͏ ✦ AWS IoT ✦ Kinesis Video Stream + Rekognition Video ✦ ӡ༻Λॿ͚Δ ✦ CloudWatch Logs ✦ API Gateway 28
29 AWS IoT
30 AWS IoT ✦ AWSͷIoT౷߹αʔϏε ✦ MQTT/HTTPSʹରԠ͠ɺRule Engineʹͯෳ ͷΞΫγϣϯ͕Մೳ ✦
MQTT Over WebSocketͰ WebSocketύΠϓͰMQTT௨৴͕Մೳ
31 AWS IoT ✦ Echo SpotεϚϗ্ͷΧʔυܾΊΒΕͨς ϯϓϨʔτʹը૾ө૾ΛࡌͤΔܗࣜ ✦ Web SocketʹࡌͤΔ͜ͱͰϒϥβ্ͱAlexa
ΛϦΞϧλΠϜ௨৴ͤ͞Δࣄ͕Ͱ͖Δ ✦ IoT SDKΛࡌͤΒΕΔͳΒεϚϗΞϓϦͱ௨৴ ͯ͠ө૾ΛมԽͤ͞Δ͜ͱ
32 AWS IoT
33 Kinesis Video Stream + Rekognition Video
34 Kinesis Video Stream + Rekognition Video ✦ ಈըετϦʔϜαʔϏε &
ੳαʔϏε ✦ AWSʹ҆શʹಈըΛετϦʔϜ͠ɺϦΞϧλΠ Ϝɺόονॲཧ྆ํʹରԠ͢Δ ✦ ಈըΛੳ͠ɺإೝࣝɺإೝূͳͲͷੳ࡞ۀ ͕ߦ͑Δ ✦ ྆αʔϏεσϑΥϧτͰ࿈ܞͰ͖Δ
35 Kinesis Video Stream + Rekognition Video ✦ EchoʹΧϝϥ͕ͳ͍ͨΊɺϊϯόʔόϧί ϛϡχέʔγϣϯ͕શ͘Ͱ͖ͳ͍
✦ ΧϝϥΛ༻ͯ͠ඇಉظʹ࿈ܞͤ͞Δ͜ͱͰ ΓͱΓʹΑΓਓؒຯΛͨͤͨΓɺ༨ܭͳΓ औΓΛলུͨ͠ΓͰ͖Δ ✦ Camera recap APIͱ͍͏ͷग़͖͍ͯͯΔ Alexa
36 Kinesis Video Stream + Rekognition Video K i n
e s i s V i d e o S t r e a m R e k o g n i t i o n V i d e o K i n e s i s D a t a S t r e a m S t r e a m P r o c e s s o r
Agenda ✦ جຊͱͯ͠ԡ͓͑ͯ͘͞αʔϏε ✦ AWS IAM ✦ DynamoDB ✦ Cognito
✦ AlexaͷදݱྗΛิ͏ ✦ AWS IoT ✦ Kinesis Video Stream + Rekognition Video ✦ ӡ༻Λॿ͚Δ ✦ CloudWatch Logs ✦ API Gateway 37
38 Cloud Watch Logs
39 CloudWatch Logs ✦ AWSͷϩάαʔϏε ✦ ࠷େ10·Ͱͷϩάอ͕Մೳ ✦ ϑΟϧλΛ͔͚ͯɺಛఆͷϩάΛநग़Ͱ͖Δ ✦
αϒεΫϦϓγϣϯϑΟϧλͰɺநग़ ͨ͠ϩάʹϦΞϧλΠϜͰॲཧΛૹΔ͜ͱ͕Ͱ ͖Δ
40 CloudWatch Logs
41 CloudWatch Logs
42 API Gateway
43 API Gateway ✦ AWSͷAPIαʔϏε ✦ खܰʹAPIΤϯυϙΠϯτΛ࡞Ͱ͖Δ ✦ ཪଆʹLambdaSNSͳͲͷAWSαʔϏεΛ ஔͨ͠ΓϓϩΩγͱͯ͠ઃఆͨ͠ΓͰ͖Δ
✦ Account LinkͷϓϩΩγͱͯ͠ஔ͢Δ͜ͱͰ OAuth2ଓͷ༰ΛϩΪϯά͢Δ͜ͱ͕Ͱ͖Δ
44 API Gateway
45 API Gateway
46 API Gateway https://bit.ly/2BuUZvl
47 ·ͱΊ ✦ AlexaͷཪଆLambdaͰ͋Δ͜ͱ͕ଟ͘ɺAWS αʔϏεͱͷੑ͕ߴ͍ ✦ ͳΔ͘AWSαʔϏεͰࡁ·͓ͤͯ͘ͱࠔͬͨͱ ͖ʹϥΫ ✦ AlexaεΩϧΛެ։͢ΔͱAWSΫϨδοτ͕Β͑
ΔͷͰɺେମແྉͰ࡞ΕΔ ✦ ࠔͬͨ࣌Developers.IOΛݟͯΈΑ͏