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

サーバーレスピタゴラスイッチ

Aipa
May 29, 2020

 サーバーレスピタゴラスイッチ

Aipa

May 29, 2020
Tweet

More Decks by Aipa

Other Decks in Technology

Transcript

  1. Lambda ྉۚ • ؔ਺ʹ 512 MB ͷϝϞϦΛׂΓ౰ͯɺ3,000,000 ճ࣮ߦ͠ɺຖճͷ࣮ߦ͕࣌ؒ 1 ඵؒͩͬͨ

    ৔߹ • ߹ܭྉۚɿίϯϐϡʔςΟϯάྉۚ ʴ ϦΫΤετྉۚ → 18.34 USD ʴ 0.40 USD = 18.74 USD/݄ → ໿2000ԁ • ίϯϐϡʔςΟϯάྉۚɿ3,000,000 × 512 MB ÷ 1024 → 1,500,000 - 400,000 GB-ඵ (ແྉ࿮) → 1,100,000 GB-ඵ × 0.00001667 USD → 18.34 USD • ϦΫΤετྉۚɿ3,000,000 - 1,000,000(ແྉ࿮) → 2,000,000 × 0.2 USD ÷ 1,000,000 → 0.40 USD
  2. Lambda Trigger Cloud Watch Events • cronΈ͍ͨͳ͜ͱ͕Ͱ͖Δ • ϑΥʔϚοτ͸cronͱRateͱݺ͹ΕΔԿ͔͕͋Δ •

    ྫʣcronͷ৔߹: ຖ೔ޕલ 10:15 (UTC) → cron(15 10 * * ? *) • ଞʹ΋ϧʔϧλΠϓͰΠϕϯτύλʔϯ ʢEC2ͷεςʔλεมԽ౳ʣΛTriggerʹ͢Δ͜ͱ͕Ͱ͖Δ
  3. ࠓޙ • σϓϩΠ͕ͩΔ͍ • Lambdaͷ૊Έ߹ΘͤɺS3ͷΠϕϯτઃఆ౳ɺϒϥ΢β͔Βϙν ϙνͰ͖Δ͚ͲԿճ΋΍Δͷ͸ΊΜͲ͍ • CodePipelineͰࣗಈσϓϩΠʹ͍ͨ͠ • GitHub,

    CodeBuild, CloudFormationΛ૊Έ߹ΘͤΔ • ΤϥʔϋϯυϦϯά͍ͨ͠ • Ͳ͔͜ͷॲཧͰϛεͬͨΒSNSͰϝʔϧ or ॲཧΛϦτϥΠ