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
43
Pkl/2024-04-17-llt31
ottijp
0
76
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
140
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
1
240
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
140
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
150
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
140
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
81
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
96
Other Decks in Programming
See All in Programming
In geheimer Mission: AI Agents entwickeln
joergneumann
0
120
バイラテラルアップサンプリング
fadis
3
590
開発者フレンドリーで顧客も満足?Platformの秘密
algoartis
0
230
The New Developer Workflow: How AI Transforms Ideas into Code
danielsogl
0
140
Serving TUIs over SSH with Go
caarlos0
0
740
AI時代のリアーキテクチャ戦略 / Re-architecture Strategy in the AI Era
dachi023
0
110
JAWS DAYS 2025 re_Cheers: WEB
komakichi
0
120
The Missing Link in Angular’s Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
150
ASP.NETアプリケーションのモダナイゼーションについて
tomokusaba
0
270
Ruby で作る RISC-V CPU エミュレーター / RISC-V CPU emulator made with Ruby
hayaokimura
5
1.2k
OpenTelemetryで始めるベンダーフリーなobservability / Vendor-free observability starting with OpenTelemetry
seike460
PRO
0
110
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
3
13k
Featured
See All Featured
Building an army of robots
kneath
305
45k
[RailsConf 2023] Rails as a piece of cake
palkan
54
5.5k
Bash Introduction
62gerente
613
210k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
For a Future-Friendly Web
brad_frost
177
9.7k
Gamification - CAS2011
davidbonilla
81
5.3k
What's in a price? How to price your products and services
michaelherold
245
12k
It's Worth the Effort
3n
184
28k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
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