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

CDKで構築したFargateのデプロイ時間を改善した話

 CDKで構築したFargateのデプロイ時間を改善した話

kaidouji85

July 12, 2023
Tweet

More Decks by kaidouji85

Other Decks in Technology

Transcript

  1. ʢਫʣ
    +"846($%,ࢧ෦
    ஛಺ɹ༎հ
    $%,Ͱߏஙͨ͠'BSHBUFͷ

    σϓϩΠ࣌ؒΛվળͨ͠࿩

    View Slide

  2. ࣗݾ঺հ
    w ஛಺༎հ
    w ΠϯσΟʔήʔϜ։ൃऀ
    w ڊେϩϘಡΈ߹͍ότϧ

    ػಈ۞ָ෦(ϒϨΠόʔόʔετ

    Λ։ൃத
    w ˢωοτରઓͰ͖ΔήʔϜͰɺ

    όοΫΤϯυʹ"84Λ࠾༻

    View Slide

  3. ͜ͷൃදʹ͍ͭͯ
    w ࠓ೔࿩͢͜ͱ
    w $%,Ͱߏஙͨ͠'BSHBUFͷσϓϩΠ࣌ؒΛվળ͢Δํ๏
    w ࠓ೔࿩͞ͳ͍͜ͱ
    w &$4ɺ'BSHBUFͷجຊతͳ஌ࣝ
    w &$4σϓϩΠλΠϓͷϩʔϦϯάߋ৽
    w $MPVE'PSNBUJPOͷجຊతͳ஌ࣝ
    w 4FSWFSMFTT'SBNFXPSLͷجຊతͳ஌ࣝ

    View Slide

  4. ग़లػಈ۞ָ෦(ϒϨΠόʔόʔεττϨΠϥʔ ೥݄ߋ৽

    IUUQTZPVUVCF+96K388ML7

    View Slide

  5. AWS Cloud
    Amazon API Gateway AWS Lambda Amazon DynamoDB
    Virtual private cloud (VPC)
    AWS Fargate
    Public subnet
    ήʔϜϓϨΠϠʔ
    1
    2
    (ϒϨ#ͷ'BSHBUF׆༻ࣄྫ
    ΧδϡΞϧϚονʹΤϯτϦ
    ϓϨΠϠʔϚονϯά
    Ϛονϯά੒ཱΛࠂ஌
    3
    ΧδϡΞϧϚονʹ'BSHBUFΛར༻

    View Slide

  6. (ϒϨ#ͷσϓϩΠ
    4FSWFSMFTT'SBNFXPSLσϓϩΠ
    %PDLFSΠϝʔδϏϧυɺ1VTI
    $%,Ͱ'BSHBUFσϓϩΠ



    ˞࣌ؒ͸ϩʔϦϯάߋ৽࣌

    View Slide

  7. վળํ๏ͷݩωλ
    w "84ެࣜͷ&$4σϓϩΠϕετϓϥΫςΟε
    w #FTU1SBDUJDFT4QFFEJOHVQEFQMPZNFOUT

    IUUQTEPDTBXTBNB[PODPN"NB[PO&$4MBUFTUCFTUQSBDUJDFTHVJEF
    EFQMPZNFOUIUNM
    w ͜ͷதͰޮՌͷ͋ͬͨ΋ͷɺͳ͔ͬͨ΋ͷΛ঺հ͢Δ

    View Slide

  8. ޮՌ͕͋ͬͨ΋ͷ4*(5&3.SFTQPOTJWFOFTT
    w 4*(5&3.Λड͚औͬͨΒɺϓϩάϥϜΛଈऴྃͤ͞ΔΑ͏ʹͨ͠
    w $.%ͰOPEFKTΛ௚઀ىಈ͢ΔΑ͏ʹͨ͠

    View Slide

  9. ղઆɹ&$4λεΫͷऴྃ
    4*(5&3.
    4*(,*--
    ऴྃॲཧ
    ʢϓϩάϥϜʣ
    λεΫऴྃ
    λΠϜΞ΢τ
    4*(5&3.Ͱଈऴྃ͠ͳ͍ͱ
    λΠϜΞ΢τ෼͚ͩϩελΠϜ͕ੜ͡Δ

    View Slide

  10. ղઆOPEFKT௚઀ىಈ
    4*(5&3.
    OQN
    OPEF
    4*(5&3.
    OPEF
    OQNεΫϦϓτܦ༝ OPEFKT௚઀ىಈ
    ଈऴྃ͠ͳ͍

    View Slide

  11. ޮՌ͕͋ͬͨ΋ͷܰྔΠϝʔδͷ࠾༻
    w 4MJNܥΛϕʔεΠϝʔδͱͯ͠࢖͏Α͏ʹͨ͠
    ໿.
    ໿.

    View Slide

  12. ΍ͬͯ΋ແҙຯͩͬͨ͜ͱ
    w NJOJNVN)FBMUIZ1FSDFOUɺNBYJNVN1FSDFOUͷௐ੔
    w &$4ϩʔϦϯάߋ৽ͷվળͰΑ͘ग़ͯ͘Δ৘ใ
    w 'BSHBUF͸্هઃఆ஋Λແࢹ͢Δ

    View Slide

  13. ΍ͬͯ΋ແҙຯͩͬͨ͜ͱʢ൪֎ฤʣ
    w $%,IPUTXBQEFQMPZNFOUT
    w ৚݅෇͖ͰDELEFQMPZΛര଎ʹͰ͖Δํ๏
    w $MPVE'PSNBUJPO0VUQVUΛࢀর͍ͯ͠Δʢ'O*NQPSU7BMVFʣ৔߹ɺ

    IPUTXBQEFQMPZNFOUT͸࢖͑ͳ͍
    4FSWFSMFTT
    'SBNFXPSL
    'BSHBUF $%,

    0VUQVUࢀর

    View Slide

  14. (ϒϨ#ͷσϓϩΠɹվળޙ
    4FSWFSMFTT'SBNFXPSLσϓϩΠ
    %PDLFSΠϝʔδϏϧυɺ1VTI
    $%,Ͱ'BSHBUFσϓϩΠ





    ˞࣌ؒ͸ϩʔϦϯάߋ৽࣌

    View Slide

  15. ·ͱΊ
    w 4*(5&3.SFTQPOTJWFOFTTɺܰྔΠϝʔδ࠾༻Ͱ

    $%,Ͱߏஙͨ͠'BSHBUFͷσϓϩΠ࣌ؒΛվળͰ͖ͨ
    w NJOJNVN)FBMUIZ1FSDFOUɺNBYJNVN1FSDFOU͸'BSHBUFͰ͸ແҙຯ
    w $MPVE'PSNBUJPO0VUQVUΛࢀর͍ͯ͠ΔͱɺIPUTXBQEFQMPZ͸࢖͑ͳ͍

    View Slide

  16. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View Slide