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

今こそはじめよう! 実践!サーバレスアーキテクチャ/serverless-sendai

今こそはじめよう! 実践!サーバレスアーキテクチャ/serverless-sendai

堀家隆宏

July 29, 2016
Tweet

More Decks by 堀家隆宏

Other Decks in Programming

Transcript

  1. αʔό͕ଘࡏ͢ΔwebαʔϏε͕੒௕͢Δͱ αʔόͷ؂ࢹ αʔόϝϯςφϯε ίʔυͷ࣮૷ ΩϟύγςΟ ϓϥϯχϯά අ΍ͤΔ࣌ؒͷׂ߹ • ૿͑ߦ͘ΞΫηε΍Ϣʔβ਺ʹର͢Δ αʔόͷߏ੒มߋɾΩϟύγςΟϓϥ

    ϯχϯά • ϞϊϦγοΫͳγεςϜʹର͢Δϝϯ ςφϯείετ • γϏΞͳݸਓ৘ใͷ؅ཧ • αʔόͷ؂ࢹ΍ͦΕʹର͢Δ24/365ͷ ରԠͷඞཁੑ ηΩϡϦςΟΞλοΫ ΁ͷରԠ
  2. αʔό͕ଘࡏ͢ΔwebαʔϏεͷ੒௕ظ αʔόͷ؂ࢹ αʔόϝϯςφϯε ίʔυͷ࣮૷ ΩϟύγςΟ ϓϥϯχϯά අ΍ͤΔ࣌ؒͷׂ߹ • ૿͑ߦ͘ΞΫηε΍Ϣʔβ਺ʹର͢Δ αʔόͷߏ੒มߋɾΩϟύγςΟϓϥ

    ϯχϯά • ϞϊϦγοΫͳγεςϜʹର͢Δϝϯ ςφϯείετ • γϏΞͳݸਓ৘ใͷ؅ཧ • αʔόͷ؂ࢹ΍ͦΕʹର͢Δ24/365ͷ ରԠ໺ඞཁੑ %%PT߈ܸͷରԠ ͢΂ͯΛΫϥ΢υαʔϏε΁ Ξ΢τιʔε
  3. Amazon Cognito Identity SDK for JavaScript https://github.com/aws/amazon-cognito-identity-js • User PoolͱwebαΠτͱͷ࿈ܞΛߦ͏ϥΠϒϥϦ

    • αΠϯΠϯɺαΠϯΞοϓɺύεϫʔυϦϚΠϯμʔ ͳͲɺϢʔβ؅ཧΛߦ͏্Ͱඞཁͳϝιου͕શ ͯ༻ҙ͞Ε͍ͯΔ • JavaScriptͰϝιουΛهड़͢Δ͚ͩͰྑ͍ɻෳ ࡶͳϏδωεϩδοΫΛ࣮૷͢Δඞཁ͸ͳ͍
  4. Customer Authorizer API 
 Gateway Cognito User Pools • API

    GatewayʹೝূೝՄͷ࢓૊ΈΛUser PoolsΛ࢖࣮ͬͯݱͰ͖Δ • ϩάΠϯࡁΈͰ͋Ε͹APIͷॲཧΛಈ࡞͞ ͤͯɺະϩάΠϯঢ়ଶͰ͋Ε͹ɺAPIͷॲ ཧΛ࣮ࢪͤ͞ͳ͍ͱ͍ͬͨ͜ͱ͕Մೳ
  5. ։ൃπʔϧ΍ϑϨʔϜϫʔΫ Serverless Framework API GatewayٴͼLambdaɺͦͷଞAWSϦιʔεΛ࢖ͬͨ ΞϓϦέʔγϣϯΛߏங͢ΔͨΊͷϑϨʔϜϫʔΫ APEX LambdaϑΝϯΫγϣϯΛϏϧυɺσϓϩΠɺ؅ཧ͢ΔͨΊ ͷπʔϧ chalice

    Serverless FrameworkʹࣅͨϑϨʔϜϫʔΫ Lamvery LambdaͷσϓϩΠ΍Functionͦͷ΋ͷΛؚΊͨपลػೳͷ ઃఆɾ؅ཧΛࢧԉ͢Δπʔϧ Simple API Gateway API GatewayͷઃఆٴͼσϓϩΠΛ؆୯ʹ͢Δπʔϧ