Upgrade to Pro — share decks privately, control downloads, hide ads and more …

IoTをServerless風にテストしたい!

Keita Mohri
August 22, 2018

 IoTをServerless風にテストしたい!

Serverless Meetup Fukuoka #2

Keita Mohri

August 22, 2018
Tweet

More Decks by Keita Mohri

Other Decks in Technology

Transcript

  1. *P5ͷσʔλϩετ͸͔ͳΓࠔΔ ‣ औΓ໭ͤͳ͍  ਓؒ૬खͱ͸ҧͬͯʮ΋͏Ұ౓ૹͬͯʯ͕Ͱ͖ͳ͍ ͜ͱ͕ଟ͍  ‣ ࣌ܥྻͰҙຯ͕͋Δ 

    ஋ͷมಈΛάϥϑͰݟ͔ͨͬͨΓ  σʔλʹԠͯ͡εςʔλε͕มΘΔ΋ͷͩͬͨΓ ‣ ॏཁͳҙຯΛ࣋ͭσʔλͷ৔߹΋  ΞϥʔτͷτϦΨʔʹͳΔΑ͏ͳ΋ͷͩͬͨΒେม
  2. ࣮σόΠε͔ΒૹΔ࡞ઓ ‣ ௐୡ  ͔ͳΓ͕͔͔࣌ؒΔ  ࣗࣾ։ൃ ηϯαʔͷબఆɾઃܭɾ࣮૷ͳͲ PSط੒඼ͷߪೖ ‣

    ॳظίετ  ୆͋ͨΓͦΕͳΓͷඅ༻͕͔͔Δ  ςετ໨తͰ५୔ʹ༻ҙ͢Δͷ͸ඇݱ࣮త ‣ धཁʹԠͨ͡εέʔϧ  ΋ͪΖΜ͠ͳ͍
  3. γϛϡϨʔλʔ͔ΒૹΔ࡞ઓ ‣ αʔόʔͷ͓ੈ࿩  Ͳ͔͜͠Βͷαʔόʔ খن໛ͳΒϩʔΧϧʁ ͔ΒૹΒͳ͚Ε͹  αʔόʔͷઃఆͱ͔͍Ζ͍Ζେม ‣

    ΋Ζ΋Ζಠ࣮ࣗ૷  #BDLFOE΁ͷ઀ଓɾೝূ  ૹΔσʔλͷத਎΍σόΠεͷঢ়ଶભҠ੍ޚ  Քಇঢ়گͷ؂ࢹ  େྔՔಇ࣌ͷεέʔϧ ‣ ςετ༻σʔλ͕ཉ͍͚ͩ͠ͳͷʹ࡞ۀྔ͕ଟ͗͢Δ
  4. ରԠϓϩτίϧɾ࿈ܞαʔϏε ɹϓϥοτϑΥʔϜ ɹαʔϏε ɹϓϩτίϧ ɹಠࣗαʔόʔ ɹ ɹ)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 ۙ೔ϦϦʔε ɹ ɹͦͷଞ ɹ͓ؾܰʹ͝૬ஊ͍ͩ͘͞
  5. ରԠϓϩτίϧɾ࿈ܞαʔϏε ɹϓϥοτϑΥʔϜ ɹαʔϏε ɹϓϩτίϧ ɹಠࣗαʔόʔ ɹ ɹ)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ʹରԠʂ
  6. "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| ςετର৅ͷΞϓϦέʔγϣϯ
  7. "84Ͱ΍ͬͯΈͨ AWS Batch ᶃίʔυΛ1VTI ᶄ$*ىಈ ᶅ"84#BUDIͷ
 +PCΛૹ৴ ؅ཧԼͷίϯϐϡʔςΟϯά؀ڥ &$ ্Ͱ+PCΛ࣮ߦ͢Δ

    &$͸࣮ߦ͢Δ+PCͷྔʹԠͯࣗ͡ಈͰ૿ݮͯ͘͠ΕΔ +PC͸ίϯςφΛ࢖࣮ͬͯߦ͢Δ
 େ୾ʹͬ͘͟Γݴ͑͹௕࣌ؒՔಇ͕Մೳͳ-BNCEB
  8. "84Ͱ΍ͬͯΈͨ AWS Batch EC2 instance Amazon ECR Container ᶃίʔυΛ1VTI ᶄ$*ىಈ

    ᶅ"84#BUDIͷ
 +PCΛૹ৴ ᶆίϯϐϡʔςΟϯά ؀ڥ࡞੒ ᶇίϯςφىಈ
  9. "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
  10. "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
  11. "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
  12. "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
  13. "84Ͱ΍ͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis

    Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ Cloudformation Stack
  14. "84Ͱ΍ͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis

    Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨஌ Cloudformation Stack
  15. "84Ͱ΍ͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis

    Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨஌ ᶎ4UBDLΛ࡟আ Cloudformation Stack
  16. "84Ͱ΍ͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis

    Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨஌ ᶎ4UBDLΛ࡟আ Cloudformation Stack ᶏ$POUBJOFSऴྃ
  17. "84Ͱ΍ͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis

    Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨஌ ᶎ4UBDLΛ࡟আ Cloudformation Stack ᶏ$POUBJOFSऴྃ ᶐίϯϐϡʔςΟϯά؀ڥ࡟আ