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

サーバーレスシステムの複雑化に立ち向かう - IoTを例にみるAWSとDDDを駆使したアプリケーション設計 #serverlesstokyo / Coding, testing, logging pattern for get along with complicated buisiness in serverless application.

664b6e8ebe272fcfa5dbd6070eaf3cd4?s=47 Yusuke Wada
September 29, 2018

サーバーレスシステムの複雑化に立ち向かう - IoTを例にみるAWSとDDDを駆使したアプリケーション設計 #serverlesstokyo / Coding, testing, logging pattern for get along with complicated buisiness in serverless application.

サーバーレスの仕組みにより、私たちは手軽にシステムのスケーラビリティを得られるようになりました。嬉しいことです。ですが、ビジネスの成長に伴って考慮することは、負荷だけではありません。ビジネスロジックの変化と拡張です。本セッションでは、サーバーレスのアプリケーションとしての側面に注目して、DDDを取り入れた設計、AWS IoTを使う状況でのテスト、そしてロギングについて議論します。

664b6e8ebe272fcfa5dbd6070eaf3cd4?s=128

Yusuke Wada

September 29, 2018
Tweet

Transcript

  1. αʔόʔϨεγεςϜͷෳࡶԽʹཱͪ޲͔͏ IoTΛྫʹΈΔAWSͱDDDΛۦ࢖ͨ͠ΞϓϦέʔγϣϯઃܭ 4FSWFSMFTTDPOG

  2.   ͋Δ։ൃऀ͕

  3. αʔόʔϨεͱ͔"84ͷ࿩ͰΑ͘ग़Δ͜͏͍͏ߏ੒ਤ   HUB-Device table Amazon DynamoDB media- bucket 

     LIXIL workers $,&)  Browser 3rd party users Lambda function $,&)    pre-signed URL Amazon API Gateway* HUB  mobile client %$ IoT certificate HUB  IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table #+  ( +&  IoT HTTP protocol IoT shadow  "*, $,&)  BOX  media- bucket backup Amazon Kinesis Firehose ', !" Amazon API Gateway*       API device- manage-SPA Amazon CloudFront Cognito *+     IoT         
  4. αʔόʔϨεͱ͔"84ͷ࿩ͰΑ͘ग़Δ͜͏͍͏ߏ੒ਤ   ͕Μ͹ͬͯͭͬͨ͘ʂ

  5. ͞Βʹ   ػೳ௥Ճʂ

  6. ͞Βʹ   ػೳ௥Ճʂ ػೳ௥Ճʂ

  7. ͞Βʹ   ػೳ௥Ճʂ ػೳ௥Ճʂ ػೳ௥Ճʂ . . . .

    . .
  8. ͋Εʁ   …͋Εʁ

  9. ͋Εʁ   …ͳΜ΍͜Ε

  10. ͋Εʁ   ΞΠίϯͪͬ͞ ͍Ζ͍Ζ͔Β·Γ͗͢΍Ζ

  11. ͋Εʁ   …ػೳ௥Ճʁվमʁ ͲΕ͕Կ΍ͬͯΜ͚ͩͬ

  12. ࠓ೔࣋ͪؼ͍͖͍ͬͯͨͩͨ͜ͱ   ҭͯΑ͏ʂ AWSαʔόʔϨεΞϓϦέʔγϣϯ

  13. ҭ͍ͯͯͨ͘Ίʹ   ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯཁૉ

  14. ҭ͍ͯͯͨ͘Ίʹ    "84-BNCEBͷϩδοΫ ΛϨΠϠԽ͢Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯཁૉ

  15. ҭ͍ͯͯͨ͘Ίʹ    "84-BNCEBͷϩδοΫ ΛϨΠϠԽ͢Δ  "84؀ڥͰ&&ςετΛ࣮ ߦ͢Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯཁૉ

  16.    "84-BNCEBͷϩδοΫ ΛϨΠϠԽ͢Δ  "84؀ڥͰ&&ςετΛ࣮ ߦ͢Δ  -BNCEB'VODUJPOͷϩ

    άΛ"84"UIFOBͰݟΒ ΕΔΑ͏ʹ͢Δ ҭ͍ͯͯͨ͘Ίʹ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯཁૉ
  17.   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ҭ͍ͯͯͨ͘Ίʹ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯཁૉ  "84-BNCEBͷϩδοΫ ΛϨΠϠԽ͢Δ

     "84؀ڥͰ&&ςετΛ࣮ ߦ͢Δ  -BNCEB'VODUJPOͷϩ άΛ"84"UIFOBͰݟΒ ΕΔΑ͏ʹ͢Δ
  18.   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ͱʹ͔͘͜Ε͕໎ࢠʹͳΓ͕ͪ ҭ͍ͯͯͨ͘Ίʹ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯཁૉ  "84-BNCEBͷϩδοΫ

    ΛϨΠϠԽ͢Δ  "84؀ڥͰ&&ςετΛ࣮ ߦ͢Δ  -BNCEB'VODUJPOͷϩ άΛ"84"UIFOBͰݟΒ ΕΔΑ͏ʹ͢Δ
  19. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ

  20. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  21. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ ͜ΕΛظ଴ͯ͠ ͬͪ͜Λ࣮ફͯ͠Έͨ࿩
  22. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  23. ࣗݾ঺հ   ࿨ా༞հ Ϋϥεϝιουגࣜձࣾ αʔόʔϨε։ൃ෦ΤϯδχΞ ޷͖4DBMB 1MBZ 5XJUUFS!XBEEZ@V

  24. ͝஫ҙ   • εϥΠυ͸ެ։͠·͢ • AWSݶఆͰ͢ɻGCPɺAzure͸Ұ੾ొ৔͠·ͤΜ • ྫࣔ͢Δۀ຿΍ιʔείʔυ͸ɺ
 ࣮ࡍͷ΋ͷ͔Βվม͍ͯ͠·͢

  25. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  26. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO ཧ࿦తͳ࿩
  27. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO ࣮ફతͳ࿩
  28. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  29. ͜Ε·Ͱ΍͖ͬͯͨαʔόʔϨεΞϓϦέʔγϣϯ ܭଌσόΠεͷσʔλΛ஝ੵ 41"ͰՄࢹԽ1P$   ίϯςϯπμ΢ϯϩʔυαΠτ

  30. גࣜձࣾ-*9*-༷εϚʔτΤΫεςϦΞ*P5αʔόʔ   HUB-Device table Amazon DynamoDB media- bucket 

     LIXIL workers $,&)  Browser 3rd party users Lambda function $,&)    pre-signed URL Amazon API Gateway* HUB  mobile client %$ IoT certificate HUB  IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table #+  ( +&  IoT HTTP protocol IoT shadow  "*, $,&)  BOX  media- bucket backup Amazon Kinesis Firehose ', !" Amazon API Gateway*       API device- manage-SPA Amazon CloudFront Cognito *+     IoT         
  31. ײ͡ΔʜʂαʔόʔϨεΞϓϦέʔγϣϯͷಘखෆಘख   ಘҙ ୯Ұͳ͍͠਺ݸͷୡ੒͍ͨ͠Ϗδωε্ͷཁ݅Λຬͨ͢Ξϓ ϦΛߴ଎ʹ࣮ݱ͢Δɻ
 ྫɿ1P$։ൃɺ*P5αʔόʔɺμ΢ϯϩʔυαΠτ ۤख ෳ਺ͷཁ͕݅བྷΈ߹͏γεςϜΛ࿅Γ্࣮͛ͯݱ͢Δɻ
 ྫɿ&$αΠτɺސ٬؅ཧγεςϜ

  32.   ཧ༝

  33.   ΞϓϦέʔγϣϯߏஙखॱͷҧ͍

  34. Ұൠతͳ8FCΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ ΞϓϦέʔγϣϯ

  35. Ұൠతͳ8FCΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ ΞϓϦέʔγϣϯ OS

  36. Ұൠతͳ8FCΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ ΞϓϦέʔγϣϯ OS ϛυϧ΢ΣΞ

  37. Ұൠతͳ8FCΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ ΞϓϦέʔγϣϯ OS ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ

  38. Ұൠతͳ8FCΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ OS ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ 1SPT Ұ౓؀ڥ͕ܾ·ΓσϓϩΠ͠ ͑͢͞Ε͹ɺ͋ͱ͸ΞϓϦέʔ

    γϣϯͱσʔλϕʔεΛҭͯͯ ͍͚͹ྑ͍ $POT ͨͱ͑γϯϓϧͳػೳͰ͋ͬͯ ΋࣮ݱ͢ΔͨΊʹ͸ࠨهͷߏ ੒ΛσϓϩΠ͢Δඞཁ͕͋Δ
  39. αʔόʔϨεΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ

  40. αʔόʔϨεΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ

  41. αʔόʔϨεΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ

  42. αʔόʔϨεΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ . . .

  43. αʔόʔϨεΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ . . . 1SPT ͻͱͭͷػೳΛσϓϩΠͯ͠ ར༻Ͱ͖ΔΑ͏ʹͳΔ·Ͱ௒

    ߴ଎ $POT ϩδοΫ͕෺ཧతʹ཭Ε͍ͯ ΔͷͰɺԿ΋ߟ͑ͣʹػೳΛ ૿΍͢ͱϝϯςίετ͕ઇͩ Δ·ࣜʹ૿͍͑ͯ͘
  44. αʔόʔϨεΞϓϦέʔγϣϯͷ৔߹   γεςϜશମ . . . 1SPT ͻͱͭͷػೳΛσϓϩΠͯ͠ ར༻Ͱ͖ΔΑ͏ʹͳΔ·Ͱ௒

    ߴ଎ $POT ϩδοΫ͕෺ཧతʹ཭Ε͍ͯ ΔͷͰɺԿ΋ߟ͑ͣʹػೳɾ ۀ຿Λ૿΍͢ͱϝϯςίετ ͕ઇͩΔ·ࣜʹ૿͍͑ͯ͘ Ͳͷίʔυ͕Կͷۀ຿Λୡ੒͢Δͷ͔ ϩδοΫ͸Ͳ͜ʹ͋Δͷ͔ ໎ࢠʹͳͬͯ͠·͏ ෳࡶͳཁ݅͸ۤख
  45. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  46. ͍·Կ΍ͬͯΔΜ͚ͩͬʁ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  47. ͍·Կ΍ͬͯΔΜ͚ͩͬʁ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ ͜ΕͷඞཁੑΛ ड़΂ͨ
  48.   ࣍ʹɺ ʮͲ͏΍Δ͔ʯ ͱ͍͏ํ਑ͷ࿩Ͱ͢

  49. %%%ɿۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ   ͔ͳΓॏްͰந৅తͳઃܭ࿦ͱܯռ͕ͪ͠Ͱ͕͢ʜ ࢲ͸ʮ։ൃαΠΫϧΛճ͠΍͍͢Α͏ʹۀ຿ϩδοΫΛ ෼཭͠·͠ΐ͏ʯఔ౓ͷղऍͰ͢ 'VODUJPOͱͯ͠ͷଆ໘Λͳ͍͕͠Ζʹ͠ͳ͍Α͏ʹ஫ ҙͭͭ͠མͱ͠ॴΛ͙͞Γ·͢

  50. %%%ɿۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ   ͔ͳΓॏްͰந৅తͳઃܭ࿦ͱܯռ͕ͪ͠Ͱ͕͢ʜ ࢲ͸ʮ։ൃαΠΫϧΛճ͠΍͍͢Α͏ʹۀ຿ϩδοΫΛ ෼཭͠·͠ΐ͏ʯఔ౓ͷղऍͰ͢ 'VODUJPOͱͯ͠ͷଆ໘Λͳ͍͕͠Ζʹ͠ͳ͍Α͏ʹ஫ ҙͭͭ͠མͱ͠ॴΛ͙͞Γ·͢ %%%΁ͷ஧࣮͞ ͱ

    'VODUJPOͱͯ͠ͷγϯϓϧ͞
  51. ෼཭ͷεςοϓ   "84ϦιʔεߏஙίʔυΛϦϙδτϦʹ·ͱΊΔ l͜͜ʹ͢΂͕ͯ͋Δz͕ਓΛ҆৺ͤ͞Δ -BNCEB'VODUJPO͚ͩσϓϩΠͰ͖ΔΑ͏ʹ͢Δ lमਖ਼ՕॴҎ֎͸Өڹͳ͠z͸ετϨεΛܰݮͤ͞Δ -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ lͲ͜ʹ͋Δ͔Θ͔Δz੔ཧ੔಴

  52. ෼཭ͷεςοϓ   "84ϦιʔεߏஙίʔυΛϦϙδτϦʹ·ͱΊΔ l͜͜ʹ͢΂͕ͯ͋Δz͕ਓΛ҆৺ͤ͞Δ -BNCEB'VODUJPO͚ͩσϓϩΠͰ͖ΔΑ͏ʹ͢Δ lमਖ਼ՕॴҎ֎͸Өڹͳ͠z͸ετϨεΛܰݮͤ͞Δ -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ lͲ͜ʹ͋Δ͔Θ͔Δz੔ཧ੔಴

  53. ෼཭ͷεςοϓ   "84ϦιʔεߏஙίʔυΛϦϙδτϦʹ·ͱΊΔ l͜͜ʹ͢΂͕ͯ͋Δz͕ਓΛ҆৺ͤ͞Δ -BNCEB'VODUJPO͚ͩσϓϩΠͰ͖ΔΑ͏ʹ͢Δ lमਖ਼ՕॴҎ֎͸Өڹͳ͠z͸ετϨεΛܰݮͤ͞Δ -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ lͲ͜ʹ͋Δ͔Θ͔Δz੔ཧ੔಴

  54. ෼཭ͷεςοϓ   "84ϦιʔεߏஙίʔυΛϦϙδτϦʹ·ͱΊΔ l͜͜ʹ͢΂͕ͯ͋Δz͕ਓΛ҆৺ͤ͞Δ -BNCEB'VODUJPO͚ͩσϓϩΠͰ͖ΔΑ͏ʹ͢Δ lमਖ਼ՕॴҎ֎͸Өڹͳ͠z͸ετϨεΛܰݮͤ͞Δ -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ lͲ͜ʹ͋Δ͔Θ͔Δz੔ཧ੔಴

  55. -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF

  56. -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF IBOEMFST EPNBJOT

    JOGSBTUSVDUVSFT
  57. -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF IBOEMFST EPNBJOT

    JOGSBTUSVDUVSFT w 'VODUJPOͷೖΓޱ w ҙࢥܾఆࢧԉ w EPNBJOTͷར༻खॱΛ ஌Δ
  58. -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF IBOEMFST EPNBJOT

    JOGSBTUSVDUVSFT w ΞϓϦͷத֩ͱͳΔΫϥε܈ w ۀ຿ w ্Լ૚͔Βੜ੒ɾར༻͞ΕΔ
  59. -BNCEB'VODUJPOͷίʔυΛ૚ʹ͢Δ   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF IBOEMFST EPNBJOT

    JOGSBTUSVDUVSFT w "84ϦιʔεΞΫηε w ೳྗ w EPNBJOT͔Βݺ͹ΕΔ
  60. lམͱ͠ॴzͷߟ࡯   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF IBOEMFST EPNBJOT

    JOGSBTUSVDUVSFT ύϥϝʔλͷύʔε ۀ຿ϑϩʔఆٛ Ϩεϙϯεੜ੒ɹ͸͜͜ ۀ຿ϩδοΫ͸͜͜ CPUP͕ඞཁͳॲཧ͸͜͜
  61. lམͱ͠ॴzͷߟ࡯   FOWJSPONFOUT JUFTU TSD UFNQMBUFT .BLFpMF IBOEMFST EPNBJOT

    JOGSBTUSVDUVSFT ύϥϝʔλͷύʔε ۀ຿ϑϩʔఆٛ Ϩεϙϯεੜ੒ɹ͸͜͜ ۀ຿ϩδοΫ͸͜͜ CPUP͕ඞཁͳॲཧ͸͜͜ ԿΑΓ΋ʮ෼ྨΛ͕Μ͹Γ͗͢ͳ͍ʯ͜ͱ
  62. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT

  63. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS create_user.py

  64. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS create_user.py get_users.py def

    lambda_handler(event, context): try: email = event['email'] company = event['company'] display_user_name = event['display_user_name'] user_level = event['user_level'] except Exception as e: logger.exception(str(e)) raise invalid_request_response(e) try: user = CreateUser( email=email, company=company, display_user_name=display_user_name, user_level=user_level ) user.insert() except Exception as e: logger.exception(str(e)) if type(e) == UserAlreadyExistsException: raise conflict_response(e) else: raise server_error(e) create_user.py
  65. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS create_user.py get_users.py def

    lambda_handler(event, context): try: email = event['email'] company = event['company'] display_user_name = event['display_user_name'] user_level = event['user_level'] except Exception as e: logger.exception(str(e)) raise invalid_request_response(e) try: user = CreateUser( email=email, company=company, display_user_name=display_user_name, user_level=user_level ) user.insert() except Exception as e: logger.exception(str(e)) if type(e) == UserAlreadyExistsException: raise conflict_response(e) else: raise server_error(e) create_user.py ԿΛ΍Δ΂͖͔͸஌ͬͯΔ͚Ͳ ۩ମతͳ࡞ۀ͸EPNBJOTʹ೚ͤΔ
  66. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user.py

  67. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user.py class CreateUser:

    def __init__(self, email, company, display_user_name, user_level): self.user_uuid = str(uuid.uuid4()) self.email = email self.company = company self.display_user_name = display_user_name self.user_level = user_level def insert(self): import infrastructures.user.user_repository as user_repository import infrastructures.user.auth_repository as auth_repository auth_repository.admin_create_user(self.user_uuid, self.email) user_repository.create(self) user.py
  68. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user.py class CreateUser:

    def __init__(self, email, company, display_user_name, user_level): self.user_uuid = str(uuid.uuid4()) self.email = email self.company = company self.display_user_name = display_user_name self.user_level = user_level def insert(self): import infrastructures.user.user_repository as user_repository import infrastructures.user.auth_repository as auth_repository auth_repository.admin_create_user(self.user_uuid, self.email) user_repository.create(self) user.py Ϣʔβʔ*%66**%Λ࢖͏
  69. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user.py class CreateUser:

    def __init__(self, email, company, display_user_name, user_level): self.user_uuid = str(uuid.uuid4()) self.email = email self.company = company self.display_user_name = display_user_name self.user_level = user_level def insert(self): import infrastructures.user.user_repository as user_repository import infrastructures.user.auth_repository as auth_repository auth_repository.admin_create_user(self.user_uuid, self.email) user_repository.create(self) user.py ೝূϦϙδτϦͱ ϢʔβʔϦϙδτϦʹ σʔλΛ࡞Δ
  70. ྫɿϢʔβʔ৘ใΛ$SFBUF͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user_repository.py auth_repository.py

  71. ྫɿϢʔβʔ৘ใΛ$36%͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user_repository.py auth_repository.py def

    create(user: CreateUser): updated_at = epoc_second_now() try: DYNAMODB_TABLE.put_item( Item={ 'user_uuid': user.user_uuid, 'email': user.email, 'company': user.company, 'display_user_name': user.display_user_name, 'created_at': updated_at, 'updated_at': updated_at }, ConditionExpression='attribute_not_exists(user_uuid)' ) except ClientError as error: if error.response['Error']['Code'] == 'ConditionalCheckFailedException': raise UserAlreadyExistsException(user.user_uuid, error) else: raise error user_repository.py
  72. ྫɿϢʔβʔ৘ใΛ$36%͢Δ-BNCEB'VODUJPO   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT VTFS user_repository.py auth_repository.py def

    create(user: CreateUser): updated_at = epoc_second_now() try: DYNAMODB_TABLE.put_item( Item={ 'user_uuid': user.user_uuid, 'email': user.email, 'company': user.company, 'display_user_name': user.display_user_name, 'created_at': updated_at, 'updated_at': updated_at }, ConditionExpression='attribute_not_exists(user_uuid)' ) except ClientError as error: if error.response['Error']['Code'] == 'ConditionalCheckFailedException': raise UserAlreadyExistsException(user.user_uuid, error) else: raise error υϝΠϯΦϒδΣΫτΛ࢖ͬͯ %ZOBNP%#ʹอଘ͢Δ CPUPΛ࢖͍͍ͬͯͷ͸͚ͩ͜͜ user_repository.py
  73. ͜͜·Ͱͷ·ͱΊ   αʔόʔϨεΞϓϦέʔγϣϯͷಛੑ Ϗδωε͕੒௕͢Δͱۀ຿ϩδοΫ͕໎ࢠʹͳΓ͕ͪ ϨΠϠԽͷεςοϓ ·ͣඞཁͳૉࡐΛҰՕॴʹूΊɺ-BNCEB'VODUJPOͷΈσ ϓϩΠͰ͖ΔΑ͏ʹ͠ɺϨΠϠʔυΞʔΩςΫνϟͷEPNBJO ૚ʹʢࡶͰ΋͍͍ͷͰʣϏδωεϩδοΫΛूΊΔ

  74. ͜͜·Ͱͷ·ͱΊ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  75. ͜͜·Ͱͷ·ͱΊ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ ͜Εͷํ਑Λड़΂ͨ
  76. ࿩͢಺༰   NJO NJO NJO NJO NJO NJO NJO

    w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ
  77. ΞϓϦέʔγϣϯ঺հ   גࣜձࣾLIXIL༷ εϚʔτ୐഑ϙετ LIXILʗIoTରԠܕ୐഑ϘοΫεΛൃച | ̡̨̣̬̚ https://lnews.jp/2018/09/k092706.html

  78. ΞϓϦέʔγϣϯ঺հ   גࣜձࣾLIXIL༷ εϚʔτ୐഑ϙετ ͷɺIoT αʔόʔ

  79. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol
  80. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol
  81. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol
  82. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol
  83. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol
  84.   ࣮ફฤ

  85. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  86. ద༻͍͖ͯ͠·͢   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  87. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol
  88. εϚʔτ୐഑ϙετొ࿥ϑϩʔ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   Device table Amazon DynamoDB  Lambda function Amazon API Gateway* HUB mobile client   IoT certificate HUB IoT policy Thing Registry IoT topic Amazon Kinesis Streams Event Table IoT HTTP protocol ϐοΫΞοϓ
  89. ୐഑ϙετొ࿥ॲཧͷϨΠϠʔԽ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   B %ZOBNP%#νΣοΫ C ొ࿥ঢ়گͷه࿥ D *P55IJOH3FHJTUSZొ ࿥ E 5IJOH(SPVQ΁ࢀՃ F 1PMJDZͷߋ৽ G ొ࿥ঢ়گͷه࿥
  90. ୐഑ϙετొ࿥ॲཧͷϨΠϠʔԽ  %ZOBNP%#΁ࣄલొ࿥  ূ໌ॻͷ
 δϟετΠϯλΠϜొ࿥  ϗʔϜϢχοτొ࿥  ୐഑ϙετొ࿥

     ҎޙɺΠϕϯτ௨৴   B %ZOBNP%#νΣοΫ C ొ࿥ঢ়گͷه࿥ D *P55IJOH3FHJTUSZొ ࿥ E 5IJOH(SPVQ΁ࢀՃ F 1PMJDZͷߋ৽ G ొ࿥ঢ়گͷه࿥ 1 Function Ͱ΍ͬͯΈΔ͜ͱʹͨ͠
  91. ϨΠϠʔԽલʢҰ෦ʣ   def lambda_handler(event, context): device_id = event[‘device_id’] uuid

    = event['uuid'] nodes = event['nodes'] types = get_device_types() groups = list_thing_groups_for_hub(uuid) group_name = groups['thingGroups'][0]['groupName'] if check_device(device_id, uuid): for node in nodes: # create thing created_node = create_node(node, types) # add thing to the group node_uuid = created_node['thingName'] add_node_to_thing_group(group_name, node_uuid) else: return nodes = list_nodes_in_hub_group(group_name) update_hub_attribute_nodes(uuid, len(nodes))
  92. ϨΠϠʔԽલʢҰ෦ʣ   def lambda_handler(event, context): device_id = event[‘device_id’] uuid

    = event['uuid'] nodes = event['nodes'] types = get_device_types() groups = list_thing_groups_for_hub(uuid) group_name = groups['thingGroups'][0]['groupName'] if check_device(device_id, uuid): for node in nodes: # create thing created_node = create_node(node, types) # add thing to the group node_uuid = created_node['thingName'] add_node_to_thing_group(group_name, node_uuid) else: return nodes = list_nodes_in_hub_group(group_name) update_hub_attribute_nodes(uuid, len(nodes)) ϋϯυϥͷΠϕϯτΛ ஌͍ͬͯΔ
  93. ϨΠϠʔԽલʢҰ෦ʣ   def lambda_handler(event, context): device_id = event[‘device_id’] uuid

    = event['uuid'] nodes = event['nodes'] types = get_device_types() groups = list_thing_groups_for_hub(uuid) group_name = groups['thingGroups'][0]['groupName'] if check_device(device_id, uuid): for node in nodes: # create thing created_node = create_node(node, types) # add thing to the group node_uuid = created_node['thingName'] add_node_to_thing_group(group_name, node_uuid) else: return nodes = list_nodes_in_hub_group(group_name) update_hub_attribute_nodes(uuid, len(nodes)) *P5ͷ࢓༷΋஌ͬͯΔ
  94. ϨΠϠʔԽલʢҰ෦ʣ   def lambda_handler(event, context): device_id = event[‘device_id’] uuid

    = event['uuid'] nodes = event['nodes'] types = get_device_types() groups = list_thing_groups_for_hub(uuid) group_name = groups['thingGroups'][0]['groupName'] if check_device(device_id, uuid): for node in nodes: # create thing created_node = create_node(node, types) # add thing to the group node_uuid = created_node['thingName'] add_node_to_thing_group(group_name, node_uuid) else: return nodes = list_nodes_in_hub_group(group_name) update_hub_attribute_nodes(uuid, len(nodes)) ϩδοΫʁ Կ͔νΣοΫͯ͠ ʜԿΛ܁Γฦ͍ͯ͠Δͷʁ
  95. ϨΠϠʔԽલʢҰ෦ʣ   def lambda_handler(event, context): device_id = event[‘device_id’] uuid

    = event['uuid'] nodes = event['nodes'] types = get_device_types() groups = list_thing_groups_for_hub(uuid) group_name = groups['thingGroups'][0]['groupName'] if check_device(device_id, uuid): for node in nodes: # create thing created_node = create_node(node, types) # add thing to the group node_uuid = created_node['thingName'] add_node_to_thing_group(group_name, node_uuid) else: return nodes = list_nodes_in_hub_group(group_name) update_hub_attribute_nodes(uuid, len(nodes)) ϩδοΫʁ Կ͔νΣοΫͯ͠ ʜԿΛ܁Γฦ͍ͯ͠Δͷʁ Կ͕͍ͨ͠ͷ͔͕ݟ͑ͳ͍ ػೳ௥Ճ͕೉͍͠
  96. ϨΠϠʔԽޙϋϯυϥ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register_handler.py

  97. ϨΠϠʔԽޙʢҰ෦ʣ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register_handler.py def lambda_handler(event,

    context): try: #ύϥϝʔλऔಘ nodes = NodeFactory.nodes_provider(param_hub_uuid, param_nodes) except Exception as e: # handle return try: task_manager = TaskManager(task_uuid, param_hub_uuid) task_manager.start() signin = SignIn(device_id, certificate_id) hub_uuid = signin.signin() service = NodeRegisterService(hub_uuid, account_id, certificate_id, nodes) node_things = service.node_register() reason = 'NodeRegisterFinished' task_manager.finish(reason) InfoLogger(node_things).log() except Exception as e: # handle return
  98. ϨΠϠʔԽޙʢҰ෦ʣ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register_handler.py def lambda_handler(event,

    context): try: #ύϥϝʔλऔಘ nodes = NodeFactory.nodes_provider(param_hub_uuid, param_nodes) except Exception as e: # handle return try: task_manager = TaskManager(task_uuid, param_hub_uuid) task_manager.start() signin = SignIn(device_id, certificate_id) hub_uuid = signin.signin() service = NodeRegisterService(hub_uuid, account_id, certificate_id, nodes) node_things = service.node_register() reason = 'NodeRegisterFinished' task_manager.finish(reason) InfoLogger(node_things).log() except Exception as e: # handle return λεΫ؅ཧ
  99. ϨΠϠʔԽޙʢҰ෦ʣ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register_handler.py def lambda_handler(event,

    context): try: #ύϥϝʔλऔಘ nodes = NodeFactory.nodes_provider(param_hub_uuid, param_nodes) except Exception as e: # handle return try: task_manager = TaskManager(task_uuid, param_hub_uuid) task_manager.start() signin = SignIn(device_id, certificate_id) hub_uuid = signin.signin() service = NodeRegisterService(hub_uuid, account_id, certificate_id, nodes) node_things = service.node_register() reason = 'NodeRegisterFinished' task_manager.finish(reason) InfoLogger(node_things).log() except Exception as e: # handle return ΫϥΠΞϯτ νΣοΫ
  100. ϨΠϠʔԽޙʢҰ෦ʣ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register_handler.py def lambda_handler(event,

    context): try: #ύϥϝʔλऔಘ nodes = NodeFactory.nodes_provider(param_hub_uuid, param_nodes) except Exception as e: # handle return try: task_manager = TaskManager(task_uuid, param_hub_uuid) task_manager.start() signin = SignIn(device_id, certificate_id) hub_uuid = signin.signin() service = NodeRegisterService(hub_uuid, account_id, certificate_id, nodes) node_things = service.node_register() reason = 'NodeRegisterFinished' task_manager.finish(reason) InfoLogger(node_things).log() except Exception as e: # handle return ୐഑ϙετొ࿥
  101. ϨΠϠʔԽޙʢҰ෦ʣ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register_handler.py def lambda_handler(event,

    context): try: #ύϥϝʔλऔಘ nodes = NodeFactory.nodes_provider(param_hub_uuid, param_nodes) except Exception as e: # handle return try: task_manager = TaskManager(task_uuid, param_hub_uuid) task_manager.start() signin = SignIn(device_id, code, param_hub_uuid, certificate_id) hub_uuid = signin.signin() service = NodeRegisterService(hub_uuid, account_id, certificate_id, nodes) node_things = service.node_register() reason = 'NodeRegisterFinished' task_manager.finish(reason) InfoLogger(node_things).log() except Exception as e: # handle return ୐഑ϙετొ࿥ ۩ମతͳ࡞ۀ͸ߦ͍ͬͯͳ͍͕ ॲཧͷॱংΛ஌͍ͬͯΔ ॱং͕ݟͯΘ͔Δ
  102. ϨΠϠʔԽޙυϝΠϯ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register.py TJHOVQ device_checker.py

    UBTL task_manager.py
  103. ϨΠϠʔԽޙυϝΠϯ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register.py TJHOVQ device_checker.py

    UBTL task_manager.py
  104. ϨΠϠʔԽޙυϝΠϯ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register.py TJHOVQ device_checker.py

    UBTL task_manager.py ϋϯυϥʔ͔Βར༻͞ΕΔ ֤ΫϥεΛఏڙ class NodeThings: def __init__(self, aws_account_id, certificate_id, hub_uuid, node_thing_list: List[NodeThing]): self.aws_account_id = aws_account_id self.certificate_id = certificate_id self.policy_name = get_nodes_policy_name(certificate_id) self.hub_uuid = hub_uuid self.node_thing_list = node_thing_list def update_policy(self): import infrastructures.registry.node_policy_repository as repository repository.create_policy_for_nodes(self) repository.attach_policy(self) node_things_register.py
  105. ϨΠϠʔԽޙυϝΠϯ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register.py TJHOVQ device_checker.py

    UBTL task_manager.py ϋϯυϥʔ͔Βར༻͞ΕΔ ֤ΫϥεΛఏڙ class NodeThings: def __init__(self, aws_account_id, certificate_id, hub_uuid, node_thing_list: List[NodeThing]): self.aws_account_id = aws_account_id self.certificate_id = certificate_id self.policy_name = get_nodes_policy_name(certificate_id) self.hub_uuid = hub_uuid self.node_thing_list = node_thing_list def update_policy(self): import infrastructures.registry.node_policy_repository as repository repository.create_policy_for_nodes(self) repository.attach_policy(self) ඞཁͳૉࡐΛ࢖ͬͯ node_things_register.py
  106. ϨΠϠʔԽޙυϝΠϯ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_register.py TJHOVQ device_checker.py

    UBTL task_manager.py ϋϯυϥʔ͔Βར༻͞ΕΔ ֤ΫϥεΛఏڙ class NodeThings: def __init__(self, aws_account_id, certificate_id, hub_uuid, node_thing_list: List[NodeThing]): self.aws_account_id = aws_account_id self.certificate_id = certificate_id self.policy_name = get_nodes_policy_name(certificate_id) self.hub_uuid = hub_uuid self.node_thing_list = node_thing_list def update_policy(self): import infrastructures.registry.node_policy_repository as repository repository.create_policy_for_nodes(self) repository.attach_policy(self) ۀ຿Λ࣮ߦ͢Δ
  107. ϨΠϠʔԽޙΠϯϑϥετϥΫνϟ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_thing_register_repository_.py nodes_policy_repository_.py

  108. ϨΠϠʔԽޙΠϯϑϥετϥΫνϟ   IBOEMFST EPNBJOT JOGSBTUSVDUVSFT SFHJTUSZ nodes_thing_register_repository_.py nodes_policy_repository_.py CPUPͰ"84ͱ΍ΓͱΓ͢Δ

    ʢίʔυলུʣ
  109. -BNCEB'VODUJPOͷίʔυΛϨΠϠԽͰ͖ͨ   ୐഑ϙετొ࿥Ͱػೳ௥Ճ͕͋ͬͨ৔߹ Ͳ͜ʹૠೖ͢Δॲཧ͔Λಛఆ͢Δ
 ʢIBOEMFSTʣ ͦͷॲཧΛ࣮ݱ͢ΔυϝΠϯΛઃܭ͠ɺΫϥεͱ͢Δ ʢEPNBJOTʣ ໨తΛୡ੒͢ΔͨΊͷ֎෦௨৴ॲཧΛॻ͘
 ʢJOGSBTUSVDUVSFTʣ

  110. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  111. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  112. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ ͜ΕΛ࣮ݱ͍ͨ͠
  113. αʔόʔϨεΞϓϦέʔγϣϯͷςετ   ΞϓϦέʔγϣϯߏஙखॱͷҧ͍Λ΋͏Ұ౓ γεςϜશମ OS ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ γεςϜશମ .

    . .
  114. Ұൠతͳ8FCΞϓϦέʔγϣϯͷςετ   ΞϓϦέʔγϣϯςετͷͨΊͷΤίγεςϜ͕ॆ࣮ γεςϜશମ OS ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ ίϯςφٕज़ʹΑΔந৅Խ ϩʔΧϧͰαʔϏεΛ্ཱͪ͛Δ

    ·ͨ͸ϞοΫԽ ΞϓϦέʔγϣϯϩδοΫʹରͯ͠ ॆ࣮ͨ͠ςετΛ͔͚Δ
  115. αʔόʔϨεΞϓϦέʔγϣϯͷςετ   ϩδοΫͷςετΛ͢Δͱͨ͠Βʜ γεςϜશମ . . . SAM Localʁ

    localstack ϩʔΧϧʹ্ཱͪ͛Δʁ AWS IoT ͸Ͳ͏͢Δʁ Kinesis Streams͸ʁ
  116. αʔόʔϨεΞϓϦέʔγϣϯͷςετ   ϩδοΫͷςετΛ͢Δͱͨ͠Βʜ γεςϜશମ . . . SAM Localʁ

    localstack ϩʔΧϧʹ্ཱͪ͛Δʁ AWS IoT ͸Ͳ͏͢Δʁ Kinesis Streams͸ʁ ࿑ྗʹݟ߹͏ͷ͔ʁ
  117.   ͔ͤͬ͘Lambda Funciton ͚ͩσϓϩΠͰ͖ ΔΑ͏ʹͨ͠͠

  118.   αʔόʔϨεΞϓϦέʔγϣϯͬͯ σϓϩΠͯ͠Έͳ͍ͱ Θ͔Μͳ͍͜ͱͨ͘͞Μ͋Δ͠ IAM ϙϦγʔͱ͔…

  119.   ࠷ॳ͔Β࣮؀ڥͰͷE2Eςετʹ શྗΛ஫͙ͷ͸Ͳ͏͔ʁ

  120. ޮ཰Α͘&&ςετΛߦ͏ͨΊʹ   ઃܭ͞ΕͨϩάΛग़ྗ͢Δʢ࣍ͷઅͰݴٴʣ -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏ -BNCEB'VODUJPOͷΈσϓϩΠͰ͖ΔΑ͏ʹ͢Δ
 ʢୡ੒ࡁʣ QZUFTUͷ!pYUVSFΛ্ख͘࢖͏

  121. ޮ཰Α͘&&ςετΛߦ͏ͨΊʹ   ઃܭ͞ΕͨϩάΛग़ྗ͢Δʢ࣍ͷઅͰݴٴʣ -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏ -BNCEB'VODUJPOͷΈσϓϩΠͰ͖ΔΑ͏ʹ͢Δ
 ʢୡ੒ࡁʣ QZUFTUͷ!pYUVSFΛ্ख͘࢖͏

  122. -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏   "844ZTUFNT.BOBHFSͷ1BSBNFUFS4UPSFΛ ׆༻͢Δ

  123. -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏   "844ZTUFNT.BOBHFSͷ1BSBNFUFS4UPSFΛ ׆༻͢Δ -BNCEB'VODUJPO 4".ςϯϓϨʔτྫ AWSTemplateFormatVersion: '2010-09-09' Transform:

    AWS::Serverless-2016-10-31 Parameters: AwsIotHttpEndpoint: Default: /prd/lambda/AwsIotHttpEndpoint Type: AWS::SSM::Parameter::Value<String> CommitId: Default: '000000000' Type: String DynamoDBEndpoint: Default: /prd/lambda/DynamoDBEndpoint Type: AWS::SSM::Parameter::Value<String> Env: Default: /prd/lambda/Env Type: AWS::SSM::Parameter::Value<String> Resources: NodesRegistry: Type: AWS::Serverless::Function Properties: FunctionName: !Sub ${Env}-iot_nodes_thing_registry …
  124. -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏   "844ZTUFNT.BOBHFSͷ1BSBNFUFS4UPSFΛ ׆༻͢Δ -BNCEB'VODUJPO 4".ςϯϓϨʔτྫ AWSTemplateFormatVersion: '2010-09-09' Transform:

    AWS::Serverless-2016-10-31 Parameters: AwsIotHttpEndpoint: Default: /prd/lambda/AwsIotHttpEndpoint Type: AWS::SSM::Parameter::Value<String> CommitId: Default: '000000000' Type: String DynamoDBEndpoint: Default: /prd/lambda/DynamoDBEndpoint Type: AWS::SSM::Parameter::Value<String> Env: Default: /prd/lambda/Env Type: AWS::SSM::Parameter::Value<String> Resources: NodesRegistry: Type: AWS::Serverless::Function Properties: FunctionName: !Sub ${Env}-iot_nodes_thing_registry … ؀ڥม਺ͷઃఆ ྫɿ%ZOBNP%#ςʔϒϧ໊
  125. -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏   "844ZTUFNT.BOBHFSͷ1BSBNFUFS4UPSFΛ ׆༻͢Δ &&ςετ
 pYUVSFྫ @pytest.fixture(scope='session', autouse=False) def

    ssm_parameters(request) -> SsmParameters: env = request.config.getoption('--env') yield make_parameters(env) def make_parameters(env) -> SsmParameters: # from SSM function_args = { 'Path': f'/{env}', 'Recursive': True, 'WithDecryption': True, 'MaxResults': 10, } response = SSM.get_parameters_by_path(**function_args) current_batch, next_token = extract_result(response) result = current_batch while next_token is not None: #࠶औಘ parameters_from_ssm = \ {extract_parameter_name(parameter): parameter['Value'] for parameter in result} ssm_parameters = SsmParameters(parameters_from_ssm) return ssm_parameters
  126. -BNCEB'VODUJPOͱڞ௨ͷઃఆΛ࢖͏   "844ZTUFNT.BOBHFSͷ1BSBNFUFS4UPSFΛ ׆༻͢Δ &&ςετ
 pYUVSFྫ @pytest.fixture(scope='session', autouse=False) def

    ssm_parameters(request) -> SsmParameters: env = request.config.getoption('--env') yield make_parameters(env) def make_parameters(env) -> SsmParameters: # from SSM function_args = { 'Path': f'/{env}', 'Recursive': True, 'WithDecryption': True, 'MaxResults': 10, } response = SSM.get_parameters_by_path(**function_args) current_batch, next_token = extract_result(response) result = current_batch while next_token is not None: #࠶औಘ parameters_from_ssm = \ {extract_parameter_name(parameter): parameter['Value'] for parameter in result} ssm_parameters = SsmParameters(parameters_from_ssm) return ssm_parameters ύϥϝʔλετΞ͔ΒσʔλΛऔ ಘ͠ΦϒδΣΫτੜ੒ ֤ςετͰύϥϝʔλ͕ར༻Ͱ͖Δ
  127. QZUFTUͷ!pYUVSFΛ্ख͘࢖͏   ໾ׂɿςετσʔλΛఆٛ͢Δ

  128. QZUFTUͷ!pYUVSFΛ্ख͘࢖͏   ໾ׂɿςετσʔλΛఆٛ͢Δ ໾ׂɿࣄલ৚݅Λ͋Β͔͡Ίୡ੒͓ͯ͘͠

  129. ࣄલ৚݅Λ͋Β͔͡Ίୡ੒͓ͯ͘͠   1.DynamoDB΁ࣄલొ࿥ 2.ূ໌ॻͷδϟετΠϯλΠϜొ࿥ 3.ϗʔϜϢχοτొ࿥ 4.୐഑ϙετొ࿥ 5.ҎޙɺΠϕϯτ௨৴

  130. ࣄલ৚݅ͱͳΔۀ຿Λ͋Β͔͡Ίୡ੒͓ͯ͘͠   1.DynamoDB΁ࣄલొ࿥ 2.ূ໌ॻͷδϟετΠϯλΠϜొ࿥ 3.ϗʔϜϢχοτొ࿥ 4.୐഑ϙετొ࿥ 5.ҎޙɺΠϕϯτ௨৴ ͜ΕΛςετ͠Α͏ͱ ࢥͬͨΒ

  131. ࣄલ৚݅ͱͳΔۀ຿Λ͋Β͔͡Ίୡ੒͓ͯ͘͠   1.DynamoDB΁ࣄલొ࿥ 2.ূ໌ॻͷδϟετΠϯλΠϜొ࿥ 3.ϗʔϜϢχοτొ࿥ 4.୐഑ϙετొ࿥ 5.ҎޙɺΠϕϯτ௨৴ ͜Ε͸ऴΘ͍ͬͯΔඞ ཁ͕͋Δ

  132. ࣄલ৚݅ͱͳΔۀ຿Λ͋Β͔͡Ίୡ੒͓ͯ͘͠   1.DynamoDB΁ࣄલొ࿥ 2.ূ໌ॻͷδϟετΠϯλΠϜొ࿥ 3.ϗʔϜϢχοτొ࿥ 4.୐഑ϙετొ࿥ 5.ҎޙɺΠϕϯτ௨৴ ͜Ε͸ऴΘ͍ͬͯΔඞ ཁ͕͋Δ

    @pytest.mark.usefixtures('download_cert_fixture', 'signup_fixture', 'task_fixture', 'jit_second_fixture', 'iot_thing_hub_register_fixture', 'iot_thing_nodes_register_fixture') def test_iot_nodes_register_finished( self, ssm_parameters: SsmParameters, signup_fixture: SignUpFixture, task_fixture: TaskFixture, jit_second_fixture: JitFixture, iot_thing_nodes_register_fixture: List[IotThingNodeRegisterFixture]):
  133. ࣄલ৚݅ͱͳΔۀ຿Λ͋Β͔͡Ίୡ੒͓ͯ͘͠   1.DynamoDB΁ࣄલొ࿥ 2.ূ໌ॻͷδϟετΠϯλΠϜొ࿥ 3.ϗʔϜϢχοτొ࿥ 4.୐഑ϙετొ࿥ 5.ҎޙɺΠϕϯτ௨৴ ͜Ε͸ऴΘ͍ͬͯΔඞ ཁ͕͋Δ

    @pytest.mark.usefixtures('download_cert_fixture', 'signup_fixture', 'task_fixture', 'jit_second_fixture', 'iot_thing_hub_register_fixture', 'iot_thing_nodes_register_fixture') def test_iot_nodes_register_finished( self, ssm_parameters: SsmParameters, signup_fixture: SignUpFixture, task_fixture: TaskFixture, jit_second_fixture: JitFixture, iot_thing_nodes_register_fixture: List[IotThingNodeRegisterFixture]): ࣄલॲཧ͕ऴΘͬͨঢ়ଶͰ୐഑ ϙετొ࿥ςετΛ։࢝Ͱ͖Δ
  134. ςετΛ࣮ߦ͍ͯ͠Δ༷ࢠ   > make test-integ-registry env=itg file_prefix=registry_nodes

  135. ςετΛ࣮ߦ͍ͯ͠Δ༷ࢠ   > make test-integ-registry env=itg file_prefix=registry_nodes &&ςετ͕ύε͢Δ࣮؀ڥͰಈ͘ ҆৺ײ͕͍͢͝

    શσϓϩΠ͕ා͘ͳ͍
  136. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  137. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ
  138. ͜ͷཁૉΛຬͨ͢ͱ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥ՃมߋՄೳ ΞϓϦέʔγϣϯ։ൃαΠΫϧ ͷεϐʔυΞοϓ ϓϩδΣΫτ։࢝࣌ͷ΢ΥʔϜ

    Ξοϓ࣌ؒ୹ॖ ͋ͱͰ΋Θ͔ΔɾҾ͖ܧ͛Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ ͜ΕΛ࣮ݱ͍ͨ͠
  139. ϩάग़ྗ͸༗ྗͳखஈͷͻͱ͔ͭͩʜ   ԿΛग़ͤ͹ྑ͍ʁ Ͳ͜Ͱग़ͤ͹ྑ͍ʁ Ͳ͏΍ͬͯݟΔͷʁ Ͳ͜ʹཷΊΔͷʁ -BNCEB'VODUJPOͷϩά͡ΌͩΊͳͷʁ

  140. ϩάग़ྗ͸༗ྗͳखஈͷͻͱ͔ͭͩʜ   ԿΛग़ͤ͹ྑ͍ʁ Ͳ͜Ͱग़ͤ͹ྑ͍ʁ Ͳ͏΍ͬͯݟΔͷʁ Ͳ͜ʹཷΊΔͷʁ -BNCEB'VODUJPOͷϩά͡ΌͩΊͳͷʁ ϩάΛग़ͯ͠ԿΛ͍ͨ͠ͷ͔ ੔ཧ͢Δ

  141. ϩάΛग़͢໨తΛ੔ཧ͢Δ   ΰʔϧɿྲྀΕΛ௥͑ΔΑ͏ʹ͢ΔɹͨΊͷཁ݅ ੒ޭͨ͜͠ͱ͕Θ͔Δ
 ࣦഊͨ͜͠ͱ͕Θ͔Δ ɾͲͷϦΫΤετͰ
 ɾԿͷॲཧ͕
 ɾ͍ͭ
 ɾͳͥ

  142. ϩάΛग़͢໨తΛ੔ཧ͢Δ   ΰʔϧɿྲྀΕΛ௥͑ΔΑ͏ʹ͢ΔɹͨΊͷཁ݅ w UBTL@VVJE
 ϦΫΤετΛ௥੻Ͱ͖Δ*% w MBNCEB@SFRVFTU@JE
 -BNCEBͷϦΫΤετ*%

    w EFWJDF@JE
 ΫϥΠΞϯτݻ༗ͷ*% ੒ޭͨ͜͠ͱ͕Θ͔Δ
 ࣦഊͨ͜͠ͱ͕Θ͔Δ ɾͲͷϦΫΤετͰ
 ɾԿͷॲཧ͕
 ɾ͍ͭ
 ɾͳͥ
  143. ϩάΛग़͢໨తΛ੔ཧ͢Δ   ΰʔϧɿྲྀΕΛ௥͑ΔΑ͏ʹ͢ΔɹͨΊͷཁ݅ w MBNCEB@IBOEMFS
 'VODUJPO໊ w MPH@FWFOU
 ۀ຿Λ۠ผ͢Δ໊લ

    ੒ޭͨ͜͠ͱ͕Θ͔Δ
 ࣦഊͨ͜͠ͱ͕Θ͔Δ ɾͲͷϦΫΤετͰ
 ɾԿͷॲཧ͕
 ɾ͍ͭ
 ɾͳͥ
  144. ϩάΛग़͢໨తΛ੔ཧ͢Δ   ΰʔϧɿྲྀΕΛ௥͑ΔΑ͏ʹ͢ΔɹͨΊͷཁ݅ w UJNFTUBNQ
 VOJYUJNFɻιʔτͰ౎߹͕ ྑ͍ w UJNFTUBNQ@KTU


    ਓ͕ؒݟΔ༻ ੒ޭͨ͜͠ͱ͕Θ͔Δ
 ࣦഊͨ͜͠ͱ͕Θ͔Δ ɾͲͷϦΫΤετͰ
 ɾԿͷॲཧ͕
 ɾ͍ͭ
 ɾͳͥ
  145. ϩάΛग़͢໨తΛ੔ཧ͢Δ   ΰʔϧɿྲྀΕΛ௥͑ΔΑ͏ʹ͢ΔɹͨΊͷཁ݅ ੒ޭͨ͜͠ͱ͕Θ͔Δ
 ࣦഊͨ͜͠ͱ͕Θ͔Δ ɾͲͷϦΫΤετͰ
 ɾԿͷॲཧ͕
 ɾ͍ͭ
 ɾͳͥ

    w Ͱ͖Δ͚ͩͨ͘͞Μͷ৘ใ w ϋϯυϥͷDPOUFYUɺελο ΫτϨʔεͳͲ
  146. ϩάΛग़͢໨తΛ੔ཧ͢Δ   ΰʔϧɿྲྀΕΛ௥͑ΔΑ͏ʹ͢ΔɹͨΊͷཁ݅ ͋ͱ͔Βಛఆͷ*%Ͱݕࡧ͍ͨ͠͠ ςετ͍ͯ͠Δͱ͖͸ϦΞϧλΠϜͰ΋ݟ͍ͨ

  147. ϩάग़ྗج൫      Lambda Amazon SNS Amazon

    Kinesis Firehose Amazon Athena alarm Amazon CloudWatch      Amazon Kinesis Streams
  148. ϩάग़ྗج൫      Lambda Amazon SNS Amazon

    Kinesis Firehose Amazon Athena alarm Amazon CloudWatch      Amazon Kinesis Streams try: … except Exception as e: ErrorLogger( lambda_event=event, lambda_context=context, commit_id=variables.get_commit_id(), param_hub_uuid=None, error=e, traceback=traceback.format_exc() ).log() raise e -BNCEB'VODUJPOͰϩά༻ΦϒδΣΫτΛ࡞ͬͯग़ྗ࣮ߦ
  149. ϩάग़ྗج൫      Lambda Amazon SNS Amazon

    Kinesis Firehose Amazon Athena alarm Amazon CloudWatch      Amazon Kinesis Streams try: … except Exception as e: ErrorLogger( lambda_event=event, lambda_context=context, commit_id=variables.get_commit_id(), param_hub_uuid=None, error=e, traceback=traceback.format_exc() ).log() raise e ,JOFTJT4USFBNT΁ϩά౤ೖ -BNCEB'VODUJPOͰϩά༻ΦϒδΣΫτΛ࡞ͬͯग़ྗ࣮ߦ
  150.   ੔ཧ͠·͢

  151. ྲྀΕΛ௥͑Δϩάج൫       Lambda Amazon SNS

    Amazon Kinesis Firehose Amazon Athena alarm Amazon CloudWatch Amazon Kinesis Streams w ϦΫΤετΛಛఆͰ͖ Δ*% w ॲཧΛಛఆͰ͖Δ৘ใ w ೔࣌৘ใ w पลίϯςΩετ৘ใ
  152. ྲྀΕΛ௥͑Δϩάج൫       Lambda Amazon SNS

    Amazon Kinesis Firehose Amazon Athena alarm Amazon CloudWatch Amazon Kinesis Streams w ϦΫΤετΛಛఆͰ͖ Δ*% w ॲཧΛಛఆͰ͖Δ৘ใ w ೔࣌৘ใ w पลίϯςΩετ৘ใ ͜ΕΛ
  153. ྲྀΕΛ௥͑Δϩάج൫       Lambda Amazon SNS

    Amazon Kinesis Firehose Amazon Athena alarm Amazon CloudWatch Amazon Kinesis Streams w ϦΫΤετΛಛఆͰ͖ Δ*% w ॲཧΛಛఆͰ͖Δ৘ใ w ೔࣌৘ใ w पลίϯςΩετ৘ใ ͜͏΍ͬͯग़͢
  154. ϩάग़ྗج൫      Lambda Amazon SNS Amazon

    Kinesis Firehose Amazon Athena alarm Amazon CloudWatch      Amazon Kinesis Streams "NB[PO"UIFOBͰͷ ݟ͑ํͲΜͳײ͡ʁ ͅ
  155. "84"UIFOBͰݟͯΈΔ   ಛఆͷΫϥΠΞϯτ*%ͷྲྀΕΛ௥͍͍ͨ৔߹ SELECT level, log_event, lambda_handler, lambda_commit_id, timestamp_jst

    FROM application WHERE device_id = ‘123456789’ and timestamp >= 1527744698 ORDER BY timestamp desc
  156. "84"UIFOBͰݟͯΈΔ   SELECT level, log_event, lambda_handler, lambda_commit_id, timestamp_jst FROM

    application WHERE device_id = ‘123456789’ and timestamp >= 1527744698 ORDER BY timestamp desc ༨ஊɿ-BNCEB 'VDOUJPO͕ͲͷόʔδϣϯͰಈ͍ͯ ͍Δ͔Θ͔ΔͷͰ $PNNJU*E͓͢͢Ί ಛఆͷΫϥΠΞϯτ*%ͷྲྀΕΛ௥͍͍ͨ৔߹
  157. "84"UIFOBͰݟͯΈΔ   ಛఆͷΫϥΠΞϯτ*%ͷྲྀΕΛ௥͍͍ͨ৔߹ δϟετΠϯλΠϜొ࿥׬ྃ

  158. "84"UIFOBͰݟͯΈΔ   ಛఆͷΫϥΠΞϯτ*%ͷྲྀΕΛ௥͍͍ͨ৔߹ ϗʔϜϢχοτͷొ࿥͕׬ྃ

  159. "84"UIFOBͰݟͯΈΔ   ಛఆͷΫϥΠΞϯτ*%ͷྲྀΕΛ௥͍͍ͨ৔߹ ୐഑ϙετͷొ࿥͕׬ྃ

  160. "84"UIFOBͰݟͯΈΔ   ಛఆͷΫϥΠΞϯτ*%ͷྲྀΕΛ௥͍͍ͨ৔߹ ୐഑ϙετͷొ࿥͕׬ྃ ࣮ࡍʹಈ͍͍ͯΔॲཧͷ༷ࢠ͕Θ͔Δʂ

  161. ϩάग़ྗج൫      Lambda Amazon SNS Amazon

    Kinesis Firehose Amazon Athena alarm Amazon CloudWatch      Amazon Kinesis Streams $MPVE8BUDI-PHTʹ ྲྀΕΔϩάΛݟ͍ͨ
  162. TBXͰݟͯΈΔ   TylerBrock/saw: Fast, multi-purpose tool for AWS CloudWatch

    Logs https://github.com/TylerBrock/saw/releases
  163. TBXͰݟͯΈΔ   TylerBrock/saw: Fast, multi-purpose tool for AWS CloudWatch

    Logs https://github.com/TylerBrock/saw/releases $MPVE8BUDI-PHTͷ ϩάάϧʔϓΛ λʔϛφϧͰετϦʔϛϯάͰ͖Δπʔϧ
  164. &&ςετΛ࣮ߦ͍ͯ͠Δͱ͖ͷϩά   > saw watch /target_log_group_name/application --expand

  165. &&ςετΛ࣮ߦ͍ͯ͠Δͱ͖ͷϩάʢ֦େʣ   > saw watch /target_log_group_name/application --expand

  166. ྲྀΕΛ௥͑ΔΑ͏ʹ͢Δɹ·ͱΊ   w ϩάग़ྗ͕༗༻ͳखஈ w ϦΫΤετ৘ใɺ΍Γ͔ͨͬͨ͜ͱɺ೔࣌ɺपลίϯ ςΩετ͕Θ͔ΔࡐྉΛग़͢ͱ਌੾ w +40/ܗ͕ࣜྑ͍ɻ"UIFOB΍TBXͰύʔε͠΍͍͢

    w ͋ͱ͔ΒݟΔ༻ʹ4 "UIFOBɺϞχλϦϯά༻ʹ $MPVE8BUDI-PHTʹ౉͢
  167. ࿩͢಺༰ w αʔόʔϨεΞϓϦέʔγϣϯ͸ෳࡶԽʹڧ͘ͳ͍ w ղܾ΁ͷΞϓϩʔνɿϩδοΫΛϨΠϠԽ͢Δ w ΞϓϦ঺հɿ"84*P5ͱܨ͕ΔεϚʔτ୐഑ϙετ w "84-BNCEBͷϨΠϠʔԽ w

    αʔόʔϨεͷςετΛ&&ςετʹৼΓ͖Δ w "84-BNCEBͷϩάΛ"84"UIFOBͰݟΔ w ૯ׅ   NJO NJO NJO NJO NJO NJO NJO
  168. ͔ͳΓۀ຿ΛؙདʹͰ͖ͨ   ۀ຿ͷ৔ॴΛ໌֬ʹ͢Δ
 ۀ຿͕ୡ੒Ͱ͖Δ͜ͱΛࣔ͢
 ۀ຿ͷྲྀΕΛ௥͑ΔΑ͏ʹ͢Δ ௥Ճมߋ͕ා͘ͳ͍"84αʔόʔϨεΞϓϦέʔγϣϯ  "84-BNCEBͷϩδοΫ ΛϨΠϠԽ͢Δ

     "84؀ڥͰ&&ςετΛ࣮ ߦ͢Δ  -BNCEB'VODUJPOͷϩ άΛ"84"UIFOBͰݟΒ ΕΔΑ͏ʹ͢Δ
  169.   ΍ͬͯΈͯͲ͏͔ͩͬͨ

  170. ྑ͔ͬͨ఺   ػೳ௥Ճɾվमͷϋʔυϧ͕େ෯ʹԼ͕ͬͨ ࠔͬͨΒશσϓϩΠɾશςετɻNBLFͰ୭Ͱ΋࣮ߦՄೳɻ &&ςετ͔ͩΒͦ͜ݟ͔ͭͬͨόά΋͋ͬͨ ಛʹϙϦγʔपΓ͸"84্Ͱಈ͔ͯ͠Έͳ͍ͱΘ͔Βͳ͍ "84"UIFOB͕େ׆༂ εςʔΫϗϧμͱͷ߹ಉςετʹ͓͍ͯɺόάௐ͓ࠪΑͼಈ࡞ূ ੻ͱͯ͠

  171. ѱ͔ͬͨ఺   ͜Ε-BNCEB'VODUJPOͰ΍Δඞཁ͋Δʁ ͳΜͲ΋ࢥͬͨɻ ઃܭΛ༏ઌ͍ͯ͠Ζ͍Ζ٘ਜ਼ʹ͍ͯ͠Δ -BNCEBͷ΢ΥʔϜελʔτͳͲɺओʹύϑΥʔϚϯε໘ &&ςετ͸"84্ͷίʔυʹରͯ͠ςετ͢Δ σϓϩΠ͠ͳ͍ͱ͍͚ͳ͍ɺΧόϨοδܭଌ͕Ͱ͖ͳ͍

  172. ૯ׅ   ·ͩ·ͩυϝΠϯۦಈઃܭͷελʔτ஍఺ ࣮ࡍʹ͸͔͜͜Β஌ࣝΛ͔Έ͖ͩ͘ɺυϝΠϯΛҭ͍ͯͯ͘ αʔόʔϨεΞϓϦέʔγϣϯͷઃܭࢦ਑ͷͻͱͭ ΦϯϥΠϯήʔϜͷόοΫΤϯυɺ෼ੳσʔλͷ&5-ɺ೔࣍ όονͳͲɺαʔόʔϨεʹٻΊΒΕΔཁ݅͸͞·͟·ɻࠓ ճͷൃද͸ɺϏδωεͷ֦ॆ͕༧૝͞ΕΔΞϓϦͷઃܭํ਑ ͱͯ͠ࢀߟʹ͍ͯͩ͘͠͞

  173. αʔόʔϨεΞϓϦέʔγϣϯͷઃܭ͸ൃల్্   ʮ΢ν͸͜͏΍ͬͯΔͥʂʯ ͥͻڞ༗͠·͠ΐ͏

  174. ࢀߟॻ੶ɾར༻ͨ͠πʔϧ   w DODGXHTFSWFSMFTT$/$'4FSWFSMFTT8(IUUQTHJUIVCDPNDODGXHTFSWFSMFTT w "844".IUUQTEPDTBXTBNB[PODPNKB@KQMBNCEBMBUFTUEHTFSWFSMFTT@BQQIUNM w .BLF(/61SPKFDUIUUQTXXXHOVPSHTPGUXBSFNBLF w

    QZUFTUEPDVNFOUBUJPOIUUQTEPDTQZUFTUPSHFOMBUFTU