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
IoTをServerless風にテストしたい!
Search
Keita Mohri
August 22, 2018
Technology
1
1.5k
IoTをServerless風にテストしたい!
Serverless Meetup Fukuoka #2
Keita Mohri
August 22, 2018
Tweet
Share
More Decks by Keita Mohri
See All by Keita Mohri
Excelを扱うRubyGemまとめ 2022
ktam1219
0
540
モクえもんのお時間です
ktam1219
0
160
在宅ワーク中だけど会社にしかGPSマルチユニットがない?でも大丈夫!そう、mockmockがあればね。
ktam1219
0
380
IoTデバイスの疑似データ送信システムにおける サーバーレスなログ処理機構の試行錯誤
ktam1219
0
530
実写版モクえもん in Explorer ~愛・おぼえていますか~
ktam1219
0
290
エンジニアのおしごと
ktam1219
0
110
mockmockの大量のログをいい感じに捌きたい
ktam1219
0
960
Goで作る大量プロセス管理機構
ktam1219
2
3.3k
わりとゴツいKubernetesハンズオン そのあとに
ktam1219
0
580
Other Decks in Technology
See All in Technology
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
190
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
強いチームと開発生産性
onk
PRO
34
11k
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
380
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
TypeScript、上達の瞬間
sadnessojisan
46
13k
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
160
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
Become a Pro
speakerdeck
PRO
25
5k
Scaling GitHub
holman
458
140k
Being A Developer After 40
akosma
86
590k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Documentation Writing (for coders)
carmenintech
65
4.4k
Automating Front-end Workflow
addyosmani
1366
200k
Bash Introduction
62gerente
608
210k
Designing for humans not robots
tammielis
250
25k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Site-Speed That Sticks
csswizardry
0
25
Producing Creativity
orderedlist
PRO
341
39k
Transcript
*P5Λ 4FSWFSMFTT෩ʹςετ͍ͨ͠ʂ ໟརܒଠ 4FSWFSMFTT.FFUVQ'VLVPLB
ࣗݾհ ໟརܒଠʢ͏Γ͚͍ͨʣ 'VTJD$P -UE ൃҊऀϓϩμΫτΦʔφʔ *P5ܥͷडୗҊ݅
લ৬ ༯ոͱ͔Ͱ༗໊ͳ ήʔϜձࣾ
ࣗݾհ IUUQTRJJUBDPN,UB.JUFNTBGBBCC IUUQTHJUIVCDPN,UB.[BSV ϝʔϧʹύεϫʔυ͖[JQΛఴͯ͠ʮύεϫʔυผ్͓ૹΓ͍ͨ͠·͢ʯ ͱ͢Δ׳श͕ΊΜͲ͍͘͞ͷͰͳΜͱ͔ͨ͠ 4FSWFSMFTTతͳաڈ࡞
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT ‣ *P5ͱςετ ‣ *P5ͱ4FSWFSMFTTͱςετͱ
*P5ͱ4FSWFSMFTT
*P5ݩ *P5ݩɹ *P5ݩɹ *P5ݩɹ *P5ݩɹ ݕࡧ ݕࡧ ݕࡧ ݕࡧ
*P5ݩ *P5ݩɹ ݕࡧ ͳ͠ ‣ ͕࣌ਐΈ࢝Ί͍ͯΔ ‣ *P5ͷ͍߹Θͤ૿͖͑ͯͨ ‣ 1P$͔Βຊ։ൃͷҠߦ૿͖͑ͯͨ
‣ େنͳ*P5։ൃ͕૿͖͍͑ͯͯΔʂ
4FSWFSMFTTͰ͋ͬͯ͘Ε ࠓͲ͖4FSWFSMFTT͡Όͳ͍ͱ ࢮΜͰ͠·͏ Backend Sensor/Device
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ো͕ى͖ͨΑʂ PS ϝϯςͯ͠Ͷʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ ো͕ى͖ͨΑʂ PS ϝϯςͯ͠Ͷʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ ো͕ى͖ͨΑʂ PS ϝϯςͯ͠Ͷʂ
োϝϯςʹରͯ͠ແ࣊൵
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device Ұؾʹ ૿͢Αʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device Ұؾʹ ૿͢Αʂ ࠓௐࢠ͕͍͍͔Β ͨ͘͞ΜૹΔΑʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device Ұؾʹ ૿͢Αʂ ࠓௐࢠ͕͍͍͔Β ͨ͘͞ΜૹΔΑʂ ϜϦϜϦϜϦ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ϜϦϜϦϜϦ ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ϜϦϜϦϜϦ ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ
εέʔϧʹରͯ͠ແ࣊൵
*P5ͷσʔλϩετ͔ͳΓࠔΔ ‣ औΓͤͳ͍ ਓؒ૬खͱҧͬͯʮ͏Ұૹͬͯʯ͕Ͱ͖ͳ͍ ͜ͱ͕ଟ͍ ‣ ࣌ܥྻͰҙຯ͕͋Δ
ͷมಈΛάϥϑͰݟ͔ͨͬͨΓ σʔλʹԠͯ͡εςʔλε͕มΘΔͷͩͬͨΓ ‣ ॏཁͳҙຯΛ࣋ͭσʔλͷ߹ ΞϥʔτͷτϦΨʔʹͳΔΑ͏ͳͷͩͬͨΒେม
*P5ͱ4FSWFSMFTT *P5ͷ൵௧ͳڣͼ োى͖ͳ͍Ͱʂ ͍͍ײ͡ʹεέʔϧͯ͠ʂ ϝϯςདྷͳ͍Ͱʂ
*P5ͱ4FSWFSMFTT *P5ͷ൵௧ͳڣͼ 4FSWFSMFTTͷแ༰ྗ োى͖ͳ͍Ͱʂ ͍͍ײ͡ʹεέʔϧͯ͠ʂ ো ΄΅ ͳ͠ εέʔϧ͕ಘҙ ͳͷ͕ଟ͍
ϝϯςདྷͳ͍Ͱʂ ϝϯς ͨͿΜ ͳ͠
*P5ͱ4FSWFSMFTT *P5ͷ൵௧ͳڣͼ 4FSWFSMFTTͷแ༰ྗ োى͖ͳ͍Ͱʂ ͍͍ײ͡ʹεέʔϧͯ͠ʂ ো ΄΅ ͳ͠ εέʔϧ͕ಘҙ ͳͷ͕ଟ͍
ϝϯςདྷͳ͍Ͱʂ ϝϯς ͨͿΜ ͳ͠
"84ᐌ͘ IUUQTXXXTMJEFTIBSFOFU"NB[PO8FC4FSWJDFT+BQBOBXTCMBDLCFMUPOMJOFTFNJOBSJPU "84#MBDL#FMU0OMJOF4FNJOBS*P5͚࠷৽ΞʔΩςΫνϟύλʔϯ
"[VSFᐌ͘ IUUQTBLBNTJPUSFGBSDIJUFDUVSF "[VSF*P53FGFSFODF"SDIJUFDUVSF(VJEF
($1ᐌ͘ IUUQTXXXZPVUVCFDPNXBUDI WLQ&U92BL "OPWFSWJFXPG$MPVE*P5$PSF (PPHMF*0
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT *P5ͷ#BDLFOE4FSWFSMFTTͰΩϚϦʂ ‣ *P5ͱςετ ‣ *P5ͱ4FSWFSMFTTͱςετͱ
*P5ͱςετ
*P5ͷςετ͕ΓͮΒ͍ ͪΌΜͱςετ͠Α͏ͱ͢Δͱ ͱͯΓͮΒ͍ Backend Sensor/Device
*P5ͷςετ͕ΓͮΒ͍ σʔλ͕དྷͳ͍ͱಈ͔ͳ͍ Backend Sensor/Device D a t a
*P5ͷςετ͕ΓͮΒ͍ ςετʹඞཁͳσʔλΛ Ͳ͔͜Βௐୡ͠Α͏ʁ Backend Sensor/Device D a t a
*P5ͷςετ͕ΓͮΒ͍ ͦͷ··࣮σόΠε͔Β σʔλΛૹΖ͏ Backend Sensor/Device D a t a
࣮σόΠε͔ΒૹΔ࡞ઓ ‣ ௐୡ ͔ͳΓ͕͔͔࣌ؒΔ ࣗࣾ։ൃ ηϯαʔͷબఆɾઃܭɾ࣮ͳͲ PSطͷߪೖ ‣
ॳظίετ ͋ͨΓͦΕͳΓͷඅ༻͕͔͔Δ ςετతͰ५ʹ༻ҙ͢Δͷඇݱ࣮త ‣ धཁʹԠͨ͡εέʔϧ ͪΖΜ͠ͳ͍
͓ʜ
͜ΕҎલզʑ͕ܾผΛਤͬͨ ʮΦϯϓϨʯతͳͭͰʁ
*P5ͷςετ͕ΓͮΒ͍ ͳΒγϛϡϨʔλʔΛ࡞ͬͯ ૹͬͯ͋͛Α͏ Backend Simulator D a t a
γϛϡϨʔλʔ͔ΒૹΔ࡞ઓ ‣ αʔόʔͷ͓ੈ Ͳ͔͜͠Βͷαʔόʔ খنͳΒϩʔΧϧʁ ͔ΒૹΒͳ͚Ε αʔόʔͷઃఆͱ͔͍Ζ͍Ζେม ‣
ΖΖಠ࣮ࣗ #BDLFOEͷଓɾೝূ ૹΔσʔλͷதσόΠεͷঢ়ଶભҠ੍ޚ Քಇঢ়گͷࢹ େྔՔಇ࣌ͷεέʔϧ ‣ ςετ༻σʔλ͕ཉ͍͚ͩ͠ͳͷʹ࡞ۀྔ͕ଟ͗͢Δ
͓ʜ
͜ΕҎલզʑ͕ܾผΛਤͬͨ ʮαʔόʔʯతͳͭͰʁ
4FSWFSMFTTతʹղܾ͠Α͏ σόΠεͷ'VODUJPOBM4BB4 Ͱ͖ͳ͍ͷ͔ʜ Backend Functional Saas? D a t a
͜Μͳײ͡ ‣ ඞཁͳͱ͖ʹ͙͢ʹௐୡͰ͖Δ ‣ αʔόʔͷଘࡏΛҙࣝͤͣʹඞཁͳ͚ͩՔಇͰ͖Δ ‣ ඞཁͳσʔλΛૹΔ͜ͱ͚ͩʹूதͰ͖Δ ‣ ϓϩάϥϜͰىಈఀࢭ੍͕ޚͰ͖Δ
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT *P5ͷ#BDLFOE4FSWFSMFTTͰΩϚϦʂ ‣ *P5ͱςετ ී௨ʹΔͱπϥ͍ɻ'VODUJPOBM4BB4ͳσόΠε͕΄͍͠ʂ ‣
*P5ͱ4FSWFSMFTTͱςετͱ
*P5ͱ4FSWFSMFTTͱςετͱ
*P5ςετ༻ԾσόΠε࡞αʔϏε ੈքॳʂ
NPDLNPDLͱʁ σόΠεʹΘͬͯ ςετ༻σʔλΛૹΔԾσόΠε Backend D a t a
ಈ࡞֓ཁ Backend ίϯιʔϧͰઃఆΛߦͳ͏ σʔλૹ৴ઌ ϓϩτίϧ σʔλੜํ๏ͷઃఆ
ঢ়ଶભҠͷઃఆ FUDʜ
ಈ࡞֓ཁ Backend NPDLΛͭ͘Δ
ಈ࡞֓ཁ Backend D a t a NPDLΛಈ͔͢
None
ରԠϓϩτίϧɾ࿈ܞαʔϏε ɹϓϥοτϑΥʔϜ ɹαʔϏε ɹϓϩτίϧ ɹಠࣗαʔόʔ ɹ ɹ)551)5514 ɹ.255.2554 ɹ"NB[PO8FC4FSWJDFT ɹɹɹ"84*P5$PSF
ɹ)5514.2554 ɹɹɹ"NB[PO,JOFTJT%BUB4USFBNT ɹ ɹ(PPHMF$MPVE1MBUGPSN ɹɹɹ$MPVE*P5$PSF ɹ.2554 ɹ.JDSPTPGU"[VSF ɹɹɹ"[VSF*P5)VC ɹ.2554 ".214 ɹ403"$0. ɹɹɹ403"$0.1MBUGPSN ɹɹɹ#FBN'VOOFM)BSWFTU ۙϦϦʔε ɹ ɹͦͷଞ ɹ͓ؾܰʹ͝૬ஊ͍ͩ͘͞
ରԠϓϩτίϧɾ࿈ܞαʔϏε ɹϓϥοτϑΥʔϜ ɹαʔϏε ɹϓϩτίϧ ɹಠࣗαʔόʔ ɹ ɹ)551)5514 ɹ.255.2554 ɹ"NB[PO8FC4FSWJDFT ɹɹɹ"84*P5$PSF
ɹ)5514.2554 ɹɹɹ"NB[PO,JOFTJT%BUB4USFBNT ɹ ɹ(PPHMF$MPVE1MBUGPSN ɹɹɹ$MPVE*P5$PSF ɹ.2554 ɹ.JDSPTPGU"[VSF ɹɹɹ"[VSF*P5)VC ɹ.2554 ".214 ɹ403"$0. ɹɹɹ403"$0.1MBUGPSN ɹɹɹ#FBN'VOOFM)BSWFTU ۙϦϦʔε ɹ ɹͦͷଞ ɹ͓ؾܰʹ͝૬ஊ͍ͩ͘͞ 4FSWFSMFTTͳ*P5#BDLFOEʹରԠʂ
"MM4FSWFSMFTT Backend D a t a 'VODUJPOBM4BB4 'VODUJPOBM4BB4 'BB4
͜͜·Ͱ͘Ε *P5ͷ&&ςετ͕ $*ͰͰ͖Δʂ
"84ͰͬͯΈͨ Thermometer Amazon Kinesis Data Streams AWS Lambda Amazon DynamoDB
{ "serial_number": "mk-00001", "timestamp": "2018-08-21T07:09:05Z", "temperatures": [ "22.8", "21.9" ] } ఆظతʹσʔλऔಘ ݅ͣͭ1VU |serial_number|timestamp |temperature01|temperature02|created_at | |-------------|-------------------|-------------|-------------|-------------------| |mk-00001 |2018/08/21 07:09:05|23.8 |25.4 |2018/08/21 07:09:06| |mk-00002 |2018/08/21 07:09:05|23.2 |24.0 |2018/08/21 07:09:06| |mk-00001 |2018/08/21 07:09:15|24.1 |25.6 |2018/08/21 07:09:17| |mk-00002 |2018/08/21 07:09:15|23.8 |24.4 |2018/08/21 07:09:18| |mk-00001 |2018/08/21 07:09:25|24.3 |25.0 |2018/08/21 07:09:26| |mk-00002 |2018/08/21 07:09:25|24.0 |23.9 |2018/08/21 07:09:27| ςετରͷΞϓϦέʔγϣϯ
σϞ
"84ͰͬͯΈͨ ᶃίʔυΛ1VTI
"84ͰͬͯΈͨ ᶃίʔυΛ1VTI ᶄ$*ىಈ
"84ͰͬͯΈͨ AWS Batch ᶃίʔυΛ1VTI ᶄ$*ىಈ ᶅ"84#BUDIͷ +PCΛૹ৴ ཧԼͷίϯϐϡʔςΟϯάڥ &$ ্Ͱ+PCΛ࣮ߦ͢Δ
&$࣮ߦ͢Δ+PCͷྔʹԠͯࣗ͡ಈͰ૿ݮͯ͘͠ΕΔ +PCίϯςφΛ࣮ͬͯߦ͢Δ େʹͬ͘͟Γݴ͑࣌ؒՔಇ͕Մೳͳ-BNCEB
"84ͰͬͯΈͨ AWS Batch EC2 instance ᶃίʔυΛ1VTI ᶄ$*ىಈ ᶅ"84#BUDIͷ +PCΛૹ৴ ᶆίϯϐϡʔςΟϯά
ڥ࡞
"84ͰͬͯΈͨ AWS Batch EC2 instance Amazon ECR Container ᶃίʔυΛ1VTI ᶄ$*ىಈ
ᶅ"84#BUDIͷ +PCΛૹ৴ ᶆίϯϐϡʔςΟϯά ڥ࡞ ᶇίϯςφىಈ
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script #!/bin/bash
git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script Amazon
Kinesis Data Streams AWS Lambda Amazon DynamoDB ᶉ%FQMPZ #!/bin/bash git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script Amazon
Kinesis Data Streams AWS Lambda Amazon DynamoDB ᶉ%FQMPZ #!/bin/bash git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh ᶊNPDLىಈ"1* Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script Amazon
Kinesis Data Streams AWS Lambda Amazon DynamoDB ᶉ%FQMPZ #!/bin/bash git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh ᶊNPDLىಈ"1* ᶋςετσʔλૹ৴ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ ᶎ4UBDLΛআ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ ᶎ4UBDLΛআ Cloudformation Stack ᶏ$POUBJOFSऴྃ
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ ᶎ4UBDLΛআ Cloudformation Stack ᶏ$POUBJOFSऴྃ ᶐίϯϐϡʔςΟϯάڥআ
"84ͰͬͯΈͨ ‣ ຊ൪ڥͱશ͘ಉ͡ڥͰςετ͕Ͱ͖Δ ‣ ςετڥཱ͕ͭͷςετͷͱ͖͚ͩ ‣ "84#BUDIΛ͍ͬͯΔͷͰ$JSDMF$*͙͢ʹख์ͤΔ ࣌ؒɺɺिؒ୯ҐͷΤΠδϯάςετͰݱ࣮తʹՄೳ
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT *P5ͷ#BDLFOE4FSWFSMFTTͰΩϚϦʂ ‣ *P5ͱςετ ී௨ʹΔͱπϥ͍ɻ'VODUJPOBM4BB4ͳσόΠε͕΄͍͠ʂ ‣
*P5ͱ4FSWFSMFTTͱςετͱ Λ͏͜ͱͰ"MM4FSWFSMFTTʹʂ$*ճͤΔʂʂ
ͷ͜Ε͔Β ‣ ͱΓ͋͑ͣ"1*ΛϦϦʔε͢Δ ϦϦʔεͨ͠Βࠓճͷ$*͕Ͱ͖·͢ ‣ ૹ৴ͨ͠σʔλΛऔಘͰ͖ΔΑ͏ʹ͢Δʂ ཷ·ͬͨσʔλͱಥ͖߹ΘͤͨΓͰ͖ͯɺςετͷ෯͕͕Δ
·ͱΊ
ຊͷ͓ ‣ *P5ͷ#BDLFOE4FSWFSMFTT͕ελϯμʔυ ‣ *P5ͷςετී௨ʹΔͱπϥ͍ ‣ Λ͏͜ͱͰ"MM4FSWFSMFTTͰςετ͕Մೳʹ ‣ ͦͷ͍ʹͬͯ$*ճͨ͠ʂ
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ IUUQTNPDLNPDLDPNKB