サーバなしで立てるウェブサイト / Build website without server

Cb8b6294609a273fd077f8a6e4536db2?s=47 Nebutan
October 17, 2018

サーバなしで立てるウェブサイト / Build website without server

JAWS-UG初心者支部 #14 発表スライド

Cb8b6294609a273fd077f8a6e4536db2?s=128

Nebutan

October 17, 2018
Tweet

Transcript

  1. αʔόͳ͠ͰཱͯΔ ΢ΣϒαΠτ ( S3 + CloudFront ) !/FCVUBO  +"846(ॳ৺ऀࢧ෦

    
  2. ࣗݾ঺հ n "84࢖͍࢝Ίͯ೥͘Β͍ n "84ೝఆιϦϡʔγϣϯΞʔΩςΫτ ΞιγΤΠτ ʢ೥໨ʣ n ઌ೔ͱ෼ͷ੒ਓࣜΛܴ͑·ͨ͠ n

    ݱࡏແ৬ͷΠϯϑϥٕज़ऀ l ٻΉ࢓ࣄʂ n 5XJUUFS!/FCVUBO5FDI Solutions Architect - Associate
  3. AWSͰ΢ΣϒαΠτཱ͍ͯͨɺͲ͏͢Δʁ n ͺͬͱࢥ͍ͭ͘ͷ͸ɺ l &$ l -JHIUTBJM n Ͱ΋αʔόཱͯΔͷ໘౗ͩΑͶ l

    ·ͣߏங͕େม l "QBDIF͔/HJOYΛΠϯετʔϧͯ͠ɺ l DPOGϑΝΠϧΛॻ͍ͯɺ l ηΩϡϦςΟ·ΘΓͷઃఆΛͯ͠ʝʝʝ l ӡ༻ͩͬͯେม l Ξοϓσʔτͷద༻ l ΞΫηεٸ૿ͨ͠ΒͲ͏͠Α͏ n 4ͱ$MPVE'SPOUͳΒαʔόͳ͠Ͱ΢ΣϒαΠτཱͯΒΕΔΑʂ
  4. ৄ͘͠͸ ʮAWS੩త΢ΣϒαΠτϗεςΟϯάʯ Ͱωοτݕࡧ

  5. Ҏ্

  6. ͦΕ͚ͩͰ͸ͳΜͳͷͰ ݕࡧ݁ՌΛ ಡΈղ͘ώϯτΛ͍͔ͭ͘

  7. ࢖༻͢ΔAWSαʔϏε 4 l )5.-ɺ$44ɺը૾ɺ+BWB4DSJQU౳ͷίϯςϯπߏ੒σʔλΛஔ͘ l ϩάϑΝΠϧஔ͖৔ͱͯ͠΋࢖͏ʢऔಘ͢Δ৔߹ʣ $MPVE'SPOU l ར༻ऀ͔ΒͷΞΫηεΛड͚ɺ4্ͷίϯςϯπσʔλΛૹΔ $FSUJGJDBUF.BOBHFS

    l 44-αʔόূ໌ॻͷൃߦɾ؅ཧ *". l αΠτߋ৽༻ΞΧ΢ϯτͷ࡞੒ɾ؅ཧ l αΠτվ͟Μ΍"84ΞΧ΢ϯτ৐ͬऔΓΛආ͚ΔͨΊɺඞͣαΠτߋ৽ ༻ΞΧ΢ϯτΛ࡞Δ 3PVUF l υϝΠϯ໊Λͦͷ··ϗετ໊ʹ͢Δ ;POF"QFY ৔߹ʹ࢖༻
  8. ΞΫηεͱ؅ཧऀϫʔΫϑϩʔ DNS ར༻ऀ αΠτ؅ཧऀ ΢Σϒαʔό (Apache, Nginx౳) ίϯςϯπσʔλ (HTMLϑΝΠϧ౳) SSLೝূہ

    HDD 1. DNSʹ΢ΣϒαʔόͷIP ΞυϨεΛ໰͍߹ΘͤΔ 2.΢Σϒαʔό͔Βίϯςϯπ σʔλΛऔಘ͢Δ a.ϗετ৘ใΛDNSʹొ࿥ b.ίϯςϯπσʔλΛ΢Σϒ αʔόʹΞοϓϩʔυ c1.SSLೝূہͰSSLαʔόূ ໌ॻͷൃߦखଓ͖Λߦ͏ c2. SSLαʔόূ໌ॻΛ ΢Σϒαʔόʹ૊ΈࠐΉ
  9. AWSʹ౰ͯ͸ΊΔͱʁ ར༻ऀ αΠτ؅ཧऀ (IAMΞΧ΢ϯτ) ίϯςϯπσʔλ (HTMLϑΝΠϧ౳) S3όέοτ a.CloudFrontͷDNSϨίʔυΛ Route53ʹొ࿥ b.ίϯςϯπσʔλΛS3όέοτ

    ʹΞοϓϩʔυ c2. SSLαʔόূ໌ॻΛ CloudFrontʹ૊ΈࠐΉ Route53 CloudFront c1.Certificate ManagerͰSSL αʔόূ໌ॻΛൃߦ Certificate Manager 1. DNSʹ΢ΣϒαʔόͷIP ΞυϨεΛ໰͍߹ΘͤΔ 2.CloudFront͔Βίϯςϯπ σʔλΛऔಘ͢Δ
  10. ֹ݄ྉۚ n લఏ l ϖʔδ͋ͨΓͷϑΝΠϧ਺ l ϖʔδʹ࢖༻͞ΕΔϑΝΠϧαΠζͷ߹ܭ.# l ݄ؒϖʔδϏϡʔ 

    αʔϏε ୯Ձ ਺ྔ ܭ S3 ετϨʔδ $0.025/GB 10GB $0.25 GETϦΫΤετ $0.00037/1,000Req 200,000Req $0.37 PUTϦΫΤετ $0.0047/1,000Req 10,000Req $0.05 CloudFront HTTPSϦΫΤετ $0.0120/10,000Req 200,000Req $1.20 σʔλసૹ(೔ຊ޲͚) $0.114/GB 50GB $5.70 Route53 ϗετκʔϯ $0.5/1κʔϯ 1κʔϯ $0.50 ΫΤϦ $0.4/1,000,000ճ 200,000ճ $0.08 ߹ܭ $8.15
  11. Ͱ͖ͳ͍͜ͱ n $(*ɾαʔόαΠυεΫϦϓτʢ1)1ɺ3BJMTɺ+41ͳͲʣ n 44*ʢ JODMVEFGJMFlFYBNQMFIUNMzͳͲʣ n '51΍4'51ͰͷΞοϓϩʔυ l 4ʹରԠͨ͠ΫϥΠΞϯτ͕ඞཁʢ$ZCFSEVDLͳͲʣ

    l গྔϑΝΠϧͷߋ৽ͳΒ.BOBHFNFOU$POTPMFͰ΋Ͱ͖Δ n #"4*$ೝূ l -BNCEBΛ࢖͑͹Ͱ͖ͳ͘΋ͳ͍ɺ͕ʝʝʝ n ݹ͍04ɾ΢Σϒϒϥ΢β΁ͷରԠ ʢ*&Ҏલɺ"OESPJEYҎલɺΨϥέʔͳͲʣ l )551ʢ҉߸Խͳ͠ʣͳΒՄೳ l ϒϥ΢β͕4FSWFS/BNF*OEJDBUJPO 4/* ʹରԠ͍ͯ͠Δඞཁ͕͋Δ l ݄ͰͳΜͱ͔Ͱ͖ͳ͘΋ͳ͍
  12. ͜Μͳ͜ͱ΍Γ͍ͨ n υϝΠϯ໊Λͦͷ··63-ʹ͍ͨ͠ IUUQFYBNQMFDPN l υϝΠϯͷωʔϜαʔόΛ3PVUFʹ͢Ε͹Մ n ΞΫηεूܭ͸Ͳ͏͢Δͷʁ l (PPHMF"OBMZUJDTΛ࢖͏ͷ͕Ұൠత

    l $MPVE'SPOUͰϩάΛऔΔ͜ͱ͸Ͱ͖Δ n 8PSE1SFTTΛ࢖͍͍ͨ l 4UBUJD1SFTTͱ͍͏ϓϥάΠϯ͕͋Δ l ͜ΕͰग़ྗͨ͠੩త)5.-Λ4ʹΞοϓϩʔυ n αΠτ಺ݕࡧΛ͚͍ͭͨ l (PPHMFͷΧελϜݕࡧΛ࢖͏ n ໰͍߹ΘͤϑΥʔϜΛ͚͍ͭͨ l (PPHMF'PSNTͳͲΛ࢖͏
  13. ͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠