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 IoTエンタープライズボタンで お手軽イベントトリガ
Search
Satoshi SAKAO
June 02, 2018
Programming
1
390
AWS IoTエンタープライズボタンで お手軽イベントトリガ
2018-06-02 ゆるゆるIT勉強会 feat.Reedex Vol.3 で発表したスライドです.
Satoshi SAKAO
June 02, 2018
Tweet
Share
More Decks by Satoshi SAKAO
See All by Satoshi SAKAO
Pkl/2024-04-17-llt31
ottijp
0
14
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
76
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
0
57
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
100
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
97
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
110
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
52
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
57
ncurses/2021-05-12-llt21
ottijp
0
140
Other Decks in Programming
See All in Programming
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
410
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
960
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
370
SIMD Parallel Programming with the Vector API
josepaumard
0
160
Ruby GitHub Packages
bkuhlmann
0
630
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
530
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
320
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
320
Ruby Pattern Matching
bkuhlmann
0
930
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
270
Site Reliability Engineering for GMO
pyama86
8
1k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Navigating Team Friction
lara
178
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
244
20k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
A designer walks into a library…
pauljervisheath
200
23k
How GitHub (no longer) Works
holman
304
140k
Music & Morning Musume
bryan
41
5.6k
It's Worth the Effort
3n
180
27k
What's in a price? How to price your products and services
michaelherold
237
11k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Transcript
AWS IoTエンタープライズボタンで お手軽イベントトリガ ゆるゆるIT勉強会 feat.Reedex Vol.3 2018/06/02 (Sat) Satoshi SAKAO
(@ottijp) Y1
Who Y2 インフォコム株式会社 オープンイノベーションセンター " アプリケーションエンジニア JS(ES6) / Node.js /
GCP / IoT / iOS (Swift) ネコ / テニス @ottijp Satoshi SAKAO
Y3 最近意識していること
Y4 ◦◦を解決 するために ◦◦やってみた・使ってみた ⇨ Problem driven Trial Problem
Y5 今回の題材( ) Problem
Y6 オフィスにおける庶務遠すぎ問題 庶務 ボス 書類 polling
Y7 オフィスにおける庶務遠すぎ問題 庶務 ボス 書類 push
Y8 庶務遠すぎ問題 を解決するために AWS IoTエンタープライズボタン使ってみた
Y9 AWS IoT Enterprise Button (エンプラボタン) 2018年5月 発売!
Y10 Amazon Dash エンプラボタン
Y11 自前の Lambda起動 エンプラボタン Amazon Dash Amazon AWS 1-click 特定商品の
発注
Y12 エンプラボタンのセットアップは簡単!
セットアップ手順 • Lambdaファンクションを作る • メール・SMS送信の場合は不要 • AWS 1-Clickアプリでエンプラボタンのセットアップ • Wi-Fi設定
• アクション(SMS・メール・Lambda)の設定 • プレイスメントの設定 • おわり Y13 1-Click
作ったLambdaファンクション Y14 1 const request = require('request') 2 3 exports.handler
= async (event) => { 4 const batteryLife = event.deviceInfo.remainingLife 5 6 const options = { 7 url: process.env.SLACK_URL, 8 headers: { 9 'Content-Type':'application/json' 10 }, 11 json: { 12 channel: process.env.SLACK_CHANNEL, 13 text: `書類投函ボタンが押されました!(バッテリ残量: ${batteryLife}%)`, 14 username: '書類箱', 15 icon_emoji: ':inbox_tray:', 16 }, 17 } 18 19 return new Promise((resolve, reject) => { 20 request.post(options, (error, response, body) => { 21 if (error) { reject(error) } 22 else { 23 resolve({ 24 statusCode: response.statusCode, 25 body, 26 }) 27 } 28 }) 29 }) 30 } Slackに通知するだけ
設置したエンプラボタン Y15
Y16 ポチっ!!
Lambdaに送られるイベント情報 Y17 1 { 2 "deviceInfo": { 3 "deviceId": "xxxxxxxxxxxxxx4T",
4 "type": "button", 5 "remainingLife": 99.8, 6 "attributes": { 7 "projectRegion": "ap-northeast-1", 8 "projectName": "doc-notifier", 9 "placementName": "team-doc-inbox", 10 "deviceTemplateName": "notify" 11 } 12 }, 13 "deviceEvent": { 14 "buttonClicked": { 15 "clickType": "SINGLE", 16 "reportedTime": "2018-05-20T12:22:40.028Z" 17 } 18 }, 19 "placementInfo": { 20 "projectName": "doc-notifier", 21 "placementName": "team-doc-inbox", 22 "attributes": { 23 24 }, 25 "devices": { 26 "notify": “xxxxxxxxxxxxxx4T" 27 } 28 } 29 } デバイス情報 クリックイベント SINGLE/DOUBLE/LONG プレイスメント
話したこと • Problem driven Trialのススメ • AWS IoT Enterprise Buttonは超お手軽
Y18
$ exit Y19
Y20 Appendix
AWS 1-Click • 物理世界から簡単にLambdaファンクションを起動するサービス • AWS IoT Coreの認証や暗号化周りなどを一括してやってくれ るようなサービス •
デバイス・プロジェクト設定とレポート機能 • 今ある対応デバイス • AWS IoTエンタープライズボタン(Wi-Fi) • AT&T LTE-M Button(LTE) Y21 AT&T LTE-M Button
AWS 1-Click Y22
AWS 1-Clickアプリ Y23
AWS 1-Clickアプリ Y24