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

AWS SAM + Rubyのすゝめ

9ec05c5a1b9b0ce9cd53ec3a63838b9a?s=47 Y_uuu
March 24, 2021

AWS SAM + Rubyのすゝめ

Fukuoka.rb 200回 LT大会 (#202)
https://fukuokarb.connpass.com/event/206956/

みんな、RubyでLambda Functionを書こう!

9ec05c5a1b9b0ce9cd53ec3a63838b9a?s=128

Y_uuu

March 24, 2021
Tweet

Transcript

  1. AWS SAM + Rubyͷ͢ʍΊ 2021-03-24(Wed ) Fukuoka.rb 200ճ LTେձ (#???)

    Ԭቌ ༤ฏ 1
  2. ॕɾFukuoka.rb 200ճ!! 🎉🎉🎉

  3. ࣗݾ঺հ Ԭቌ ༤ฏ Okazaki Yuhei ‣ I D - @yuuu

    @Y_uuu ‣ ࣗݾ঺հ • FusicͷIoTΫϥ΢υΤϯδχΞ • ݩɾ૊ࠐΈΤϯδχΞ(2018೥͔ΒWebܥ΁ ) • ࠷ۙͷ͓࢓ࣄ͸ઐΒAzure ‣ Skil l 3 image ʘNewʗ
  4. AWS Lambda 4 ‣ ͍ΘΏΔFaaS (Function as a Service) -

    αʔόϨε - εςʔτϨε - ίϯςφ - Πϕϯτۦಈ - ͪΐͬͱͨ͠ϓϩάϥϜΛ؆୯ʹಈ͔ͤΔ
  5. Lambda͸RubyͰ΋ॻ͚Δ 5 ‣ re:Invent 2018Ͱൃද - Rubyist׻تʂ - ฐࣾͰ΋RubyͰͷ࣮૷͕૿͑Δ ‣

    2020೥2݄ʹruby 2.7΋ରԠ
  6. ΋ͬͱར༻͞ΕΔ΂͖ 6 ‣ ଞͷݴޠʹൺ΂Δͱਓؾ͕௿͍Β͍͠ https://www.datadoghq.com/ja/state-of-serverless/

  7. Rubyistʹ΋ͬͱLambdaΛ࢖ͬͯ΋Β͍͍ͨʂ AWS SAM + Rubyͷ͢ʍΊ

  8. AWS SAM 8 ‣ SAM=Serverless Application Mode l - LambdaΛத৺ͱͨ͠AWSϦιʔεΛ؆୯ʹ࡞੒

    - CLIΛ࢖ͬͯ؆୯ʹߏஙɾςετɾσϓϩΠՄೳ
  9. 3 STEPͰ؆୯σϓϩΠʂ ࢖͍ํ

  10. STEP0. ࣄલ४උ 10 ‣ AWSΞΧ΢ϯτͷ࡞੒ ‣ AWS SAM CLIͷΠϯετʔϧ -

    https://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/ developerguide/serverless-sam-cli-install.html ‣ AWSೝূ৘ใͷઃఆ - https://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/ developerguide/serverless-getting-started-set-up-credentials.html AWS SAMΛ࢖͏ͨΊʹҎԼͷ४උ͕ඞཁͰ͢
  11. STEP1. ϓϩδΣΫτ࡞੒ 11 AWS SAM CLIΛ࢖ͬͯϓϩδΣΫτΛ࡞੒͠·͢

  12. STEP1. ϓϩδΣΫτ࡞੒ 12 ໎Θͣʮ3 - ruby2.7ʯΛબ୒͠·͠ΐ͏

  13. STEP2.ίʔσΟϯά 13 ༧Ίhello_world͕αϯϓϧͱͯ͠༻ҙ͞Ε͍ͯΔ

  14. STEP2.ίʔσΟϯά 14 AWSϦιʔεߏ੒Λtemplate.ymlʹهड़

  15. STEP2.ίʔσΟϯά 15 ඞཁͳRubyGemΛGemfileʹ௥Ճ

  16. STEP2.ίʔσΟϯά 16 app.rbʹRubyͷϓϩάϥϜΛهड़

  17. STEP3.σϓϩΠ 17 AWS SAM CLIΛ࢖ͬͯϏϧυˠσϓϩΠ

  18. STEP3.σϓϩΠ 18 AWS SAM CLIΛ࢖ͬͯϏϧυˠσϓϩΠ

  19. API͕׬੒ 19 https://bit.ly/3qUzb0K

  20. ࠷ۙ࡞ͬͨ΋ͷΛ঺հ Ԡ༻ྫ

  21. Թ౓ηϯαΛ࢖ͬͨIoTγεςϜ 21 Թ౓ηϯα͔Βଌఆ஋Λऩूˠ௨஌ https://github.com/yuuu/iot_dev_starting_book_site AWS SAMͰߏங

  22. Թ౓ηϯαΛ࢖ͬͨIoTγεςϜ 22 ϒϥ΢βͰଌఆ஋ΛάϥϑԽ https://github.com/yuuu/iot_dev_starting_book_site AWS SAMͰߏங

  23. ToFଌڑηϯαΛ࢖ͬͨண࠲؂ࢹγεςϜ 23 ଌఆ஋ʹԠͨ͡ϑΟʔυόοΫ੍ޚ https://github.com/yuuu/build_and_learn_soracom_book_site AWS SAMͰߏங

  24. ฐࣾࣾһͷ20ࡀͷ஀ੜ೔ΛΧ΢ϯτμ΢ϯ͢ΔSlack Bot 24 ੒ਓࣾһ͔ΒͷΞυόΠεΛఴ͑ͯΧ΢ϯτμ΢ϯϝοηʔδΛPOST

  25. ·ͱΊ 25 •RubyͰLambdaΛॻ͖·͠ΐ͏ʂ • ͜͜·Ͱ5෼Ҏ಺ʹऩ·͍ͬͯΔ͸ͣʘ(^o^)ʗ

  26. ͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠ Thank You We are Hiring ! https://recruit.fusic.co.jp/