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

Lambda@Edgeで複数オリジンに振り分けてみた

kawaji
November 13, 2021

 Lambda@Edgeで複数オリジンに振り分けてみた

2021/11/13 クラウドお遍路

kawaji

November 13, 2021
Tweet

More Decks by kawaji

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w ઒࿏ོٛ w ̏ࣇͷ෕ʢখɺɼஉࢠʣ w ༗ݶձࣾདྷ੘઒ిࢉॴଐ w ίϛϡχςΟ 


    +"846(ಙౡ໊ݹ԰ 
 Ұൠࣾஂ๏ਓ&4%ཧࣄ w ུྺ 
 14ήʔϜ։ൃɺύνϯίձࣾ ৽ଔ̍೥ ɺϑϦ ʔϥϯεʢ̑೥ʣɺ๏ਓܦӦʢ̍̐೥ʣˠฏࣾ һʢ೥ʣ !LBXBKJ@TDSBUDI
  2. -BNCEB!&EHF ಛ௃ ίϯςϯπ഑৴ΛΧελϚΠζ͢Δ Ϣʔβʔʹ͍ۙϦʔδϣϯͰ࣮ߦ͞ΕΔ -BNCEBͳͷͰαʔόʔߏங͕ෆཁ Ϣʔεέʔε Ұྫ  ΦϦδϯϨεϙϯεͷϔομʔΛՃ޻ ηΩϡϦςΟཁ݅ͳͲ

     ಈతͳϧʔςΟϯά ϏϔΠϏΞ΁ͷQBUIʹΑΔϧʔϧઃఆͰ͸࣮ݱͰ͖ͳ͍ϧʔςΟϯά͕Մೳ -BNCEBͱͯ͠%ZOBNP%#ͳͲͷ৘ใΛར༻ͯ͠ෳࡶͳཁ݅΋૊ΈࠐΊΔ
  3. -BNCEB!&EHF ಛ௃ ίϯςϯπ഑৴ΛΧελϚΠζ͢Δ Ϣʔβʔʹ͍ۙϦʔδϣϯͰ࣮ߦ͞ΕΔ -BNCEBͳͷͰαʔόʔߏங͕ෆཁ Ϣʔεέʔε Ұྫ  ΦϦδϯϨεϙϯεͷϔομʔΛՃ޻ ηΩϡϦςΟཁ݅ͳͲ

     ಈతͳϧʔςΟϯά ϏϔΠϏΞ΁ͷQBUIʹΑΔϧʔϧઃఆͰ͸࣮ݱͰ͖ͳ͍ϧʔςΟϯά͕Մೳ -BNCEBͱͯ͠%ZOBNP%#ͳͲͷ৘ใΛར༻ͯ͠ෳࡶͳཁ݅΋૊ΈࠐΊΔ ࠓ೔঺հ͢ΔϢʔεέʔε
  4. ΍Γ͍ͨ͜ͱ ͜ΕΛ ༏ઌॱҐ ύεύλʔϯ ΦϦδϯ  BQJ "1*(BUFXBZ  

    BQQPSBQQΛอ͍࣋ͯ͠Δ4όέοτΛ͍͍ײ͡Ͱ ৼΓ෼͚Δ ༏ઌॱҐ ύεύλʔϯ ΦϦδϯ  BQJ "1*(BUFXBZ  BQQ BQQΛอ͍࣋ͯ͠Δ4όέοτ  BQQ BQQΛอ͍࣋ͯ͠Δ4όέοτ ͜͏͍ͨ͠
  5. $MPVE'SPOU'VODUJPOT 3FBDU "OHVMBSͳͲͷ4"1'SBNFXPSLΛར༻͢ΔͱɺϏϧυʹΑΔ੒Ռ෺ ͕JOEFYIUNMͱΞηοτ KBWBTDSJQU ը૾ ͱͳΔ ը໘ભҠʹ͸IPNF MPHJOͳͲར༻͢Δ͕࣮ࡍରԠ͢ΔϦιʔε IUNM

    ͸ଘ ࡏ͠ͳ͍ ͜ͷΑ͏ͳ࣌ʹ4ΛΦϦδϯͱͯ͠ར༻͢ΔͱΤϥʔ͕ฦ͞ΕΔ Τϥʔ͕ฦ͞Εͨ࣌ʹJOEFYIUNMΛฦ͢ํ๏͕঺հ͞ΕͨΓ͍ͯ͠Δ͕ɺ $MPVE'SPOU'VODUJPOTΛར༻ͯ͠ϧʔςΟϯάͯ͋͛͠Δͱ࢖͍΍͍͢ 
 ʢ$MPVE'SPOUͷཪʹ"1*(BUFXBZ͕ଘࡏ͢ΔͱΤϥʔ࣌ʹIUNMΛฦ͢͸ࠔΔͷͰʣ ࡢࠓͷSPA(Single P a ge Applic a tion)Λ੩తίϯςϯπͱͯ͠S3ʹஔ࣌͘ʹศར
  6. $MPVE'SPOU'VODUJPOT w ࣮Ϧιʔε͕ଘࡏ͠ͳ͍ύεΛཁٻ͞Εͨͱ͖͸JOEFYIUNMʹϧʔςΟϯά ͢Δ͚ͩ w ύε͕Ұ཯JOEFYIUNMʹͳΔ͜ͱͰݸผύεͰͷΩϟογϡͰ͸ͳ͘Ωϟο γϡ͕ޮ཰త w ͨͩɺݱঢ়KBWBTDSJQU &4

    ͔͠ར༻Ͱ͖ͳ͍ͷͰ஫ҙɻ.BQ 4FUͱ͔ͳ͍ݴ ޠʹ఍߅ײ͸͋Δ΋ͷͷͦΜͳʹෳࡶͳ͜ͱΛ͢Δ͜ͱ͸૝ఆ͠ͳ͍ͷͰେ ৎ෉ɻ w γϛϡϨʔλ͕ଘࡏͯ͠NTҎ಺ʹऩ·Δ͔͸ࣄલνΣοΫՄೳ ࡢࠓͷSAP(Single P a ge Applic a tion)Λ੩తίϯςϯπͱͯ͠S3ʹஔ࣌͘ʹศར