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
400
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
Testcontainers/2024-11-20-llt32
ottijp
0
28
Pkl/2024-04-17-llt31
ottijp
0
64
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
130
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
1
210
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
130
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
140
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
130
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
73
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
87
Other Decks in Programming
See All in Programming
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
200
テストをしないQAエンジニアは何をしているか?
nealle
0
130
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
Software Architecture
hschwentner
6
2.1k
Introduction to kotlinx.rpc
arawn
0
630
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
210
ARA Ansible for the teams
kksat
0
150
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
130
Grafana Cloudとソラカメ
devoc
0
140
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
41
15k
DROBEの生成AI活用事例 with AWS
ippey
0
130
Linux && Docker 研修/Linux && Docker training
forrep
23
4.5k
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Embracing the Ebb and Flow
colly
84
4.6k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
240
It's Worth the Effort
3n
184
28k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Why Our Code Smells
bkeepers
PRO
335
57k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Designing for humans not robots
tammielis
250
25k
Being A Developer After 40
akosma
89
590k
YesSQL, Process and Tooling at Scale
rocio
171
14k
How STYLIGHT went responsive
nonsquared
98
5.3k
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