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
620
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
2k
結局普通のエンジニアが今SageMaker使うと何ができるのかわかるLT
chao2suke
0
1.6k
機械学習の知識ゼロでも動かせるAIツールキットの世界
chao2suke
0
1.5k
「今」のAI技術と「3年後」のAI技術のご紹介
chao2suke
0
970
Alexaに詳しい人は普段Alexaをどう扱っているか
chao2suke
0
810
奥深きAPLの世界
chao2suke
0
120
Alexaスキル & レジレスCafeにおけるStripe活用の取り組み
chao2suke
0
1.9k
Alexa x 機械学習でスキルをよりリッチにする方法
chao2suke
0
1.5k
#AAJUG vol.2 APL ハンズオン
chao2suke
0
2.5k
Other Decks in Technology
See All in Technology
Garoon 開発チーム / Garoon development team
cybozuinsideout
PRO
1
2.9k
巨大なテーブルのテーブル定義を無停止で安全に誰でも変更できるようにする / Table-definitions-for-huge-tables-can-be-modified-by-anyone-safely-and-non-disruptively
freee
1
720
Postman v10リリース後を振り返る
nagix
0
120
コードを書く隙間を見つけて生きていく技術/Findy 思考の現在地
fujiwara3
24
4.8k
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
320
次世代Web認証「パスキー」 / mo-zatsudan-passkey
nkzn
22
13k
Hands-on / Kaname Frusawa / Cloud Compare Users Meetup 2024 at University of Tokyo on April 17
paraworld
2
470
強みを伸ばすキャリアデザイン
yug1224
0
200
"好き"との生活/Regularly update profile with GitHub Actions
judeeeee
0
140
「手動オペレーションに定評がある」と言われた私が心がけていること / phpcon_odawara2024
blue_goheimochi
1
310
オブザーバビリティの Primary Signals
onk
PRO
0
530
「共通基盤」を超えよ! 今、Platform Engineeringに取り組むべき理由
jacopen
25
5.7k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Statistics for Hackers
jakevdp
789
220k
Faster Mobile Websites
deanohume
296
30k
Clear Off the Table
cherdarchuk
82
310k
Making Projects Easy
brettharned
107
5.5k
The Cost Of JavaScript in 2023
addyosmani
13
3.8k
Fireside Chat
paigeccino
19
2.6k
A Modern Web Designer's Workflow
chriscoyier
689
190k
YesSQL, Process and Tooling at Scale
rocio
162
13k
Infographics Made Easy
chrislema
237
18k
VelocityConf: Rendering Performance Case Studies
addyosmani
319
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
10
4.5k
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ΛݟͯΈΑ͏