2019-02-23 今日からはじめるCI/CD…のためのAWSアーキテクチャ事始め/20190223-jawsdays-arch

Ea29e2b19d11b48f867ae71d6a6de5df?s=47 opelab
February 23, 2019

2019-02-23 今日からはじめるCI/CD…のためのAWSアーキテクチャ事始め/20190223-jawsdays-arch

JAWS Days 2019でのJAWS-UGアーキテクチャ専門支部枠「今日からはじめるCI/CD…のためのAWSアーキテクチャ事始め」の発表資料です。

https://jawsdays2019.jaws-ug.jp/session/2220/

(運用設計ラボ合同会社 波田野裕一)

Ea29e2b19d11b48f867ae71d6a6de5df?s=128

opelab

February 23, 2019
Tweet

Transcript

  1. Operation Lab ӡ༻ઃܭϥϘ ӡ༻ઃܭϥϘ߹ಉձࣾ ࠓ೔͔Β͸͡ΊΔ$*$% 1  Architecture 8BOUFE0VSPSJHJOBMMPHP JAWS-UG

    ARCH ΞʔΩςΫνϟઐ໳ࢧ෦ γχΞΞʔΩςΫτ೾ా໺༟Ұ ʜͷͨΊͷ"84ΞʔΩςΫνϟࣄ࢝Ί
  2. Operation Lab ӡ༻ઃܭϥϘ ࣗݾ঺հ 2 ೾ా໺༟Ұ "844BNVSBJ ೥݄͔Β +"846($-*ઐ໳ࢧ෦ࢧ෦௕ +"846(ΞʔΩςΫνϟઐ໳ࢧ෦ӡӦ

    +"846("*ࢧ෦ӡӦ 95FDI+"84ӡӦ
  3. ࡢࠓͷΤϯδχΞք۾ Operation Lab ӡ༻ઃܭϥϘ 3 $*$%ͬͯ΋͏౰ͨΓલͩΑͶ ύΠϓϥΠϯݟͯΔ͚ͩͰ൧΢Ϛʂ ͝൧ഋ͸ΠέΔʂ ͱ͍͏੠͕ͦ͜Β͡Ύ͏͔Βฉ͑͜Δ೥ͷय़Ͱ͕͢ɺ

  4. ͱ͸ݴ͏΋ͷͷ Operation Lab ӡ༻ઃܭϥϘ 4 ʮ$*$%΍ͬͨํ͕͍͍ͷ͸Θ͔Δ͚ͲɺͲ͜ ͔ΒखΛ෇͚͍͍ͯͷ͔Θ͔ΒΜʯ ʮ$*$%ɺͳʹͦΕඒຯ͍͠ͷʁʯ ʮϫλγɺ$*$%θϯθϯϫΧϥφʔΠʼʻʯ ͱ͍͏੠΋ͪΒ΄Βฉ͖͑ͯ͜·͢ɻ

  5. ͱ͸ݴ͏΋ͷͷ Operation Lab ӡ༻ઃܭϥϘ 5 ʮ$*$%΍ͬͨํ͕͍͍ͷ͸Θ͔Δ͚ͲɺͲ͜ ͔ΒखΛ෇͚͍͍ͯͷ͔Θ͔ΒΜʯ ʮ$*$%ɺͳʹͦΕඒຯ͍͠ͷʁʯ ʮϫλγɺ$*$%θϯθϯϫΧϥφʔΠʼʻʯ ͱ͍͏੠΋ͪΒ΄Βฉ͖͑ͯ͜·͢ɻ

    Θͨ͠΋Ͳ͔ͬͪͱ͍͏ͬͪ͜Ͱ͢
  6. +"846(ΞʔΩςΫνϟઐ໳ࢧ෦ ࠷ۙ • ӡӦͷਓ͸ΠϯϑϥܥΤϯδχΞ • $*$%͕ؾʹͳ͍ͬͯΔ͚Ͳɺͭ·Έ৯͍ఔ౓ • ʮύΠϓϥΠϯώϟοϋʔʯݴͬͯΈ͍ͨ • $*$%ʹڵຯ͋Δɺ೰ΜͰΔΈͳ͞Μͱٞ࿦

    Operation Lab ӡ༻ઃܭϥϘ 6
  7. ηογϣϯ֓ཁ ର৅$*$%ʹڵຯ͸͋Δ͚Ͳɺͳ͔ͳ͔ணखͰ͖͍ͯͳ͍ํ "84ͷ$*$%ؔ࿈αʔϏεͷ׆༻ʹ͍ͭͯɺ +"846(ΞʔΩςΫνϟઐ໳ࢧ෦ʹ͓͚Δٞ࿦Λ৫Γަͥͭͭ ঺հ͍͖ͯ͠·͢ɻ Operation Lab ӡ༻ઃܭϥϘ 7

  8. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷશମ૾ 8

  9. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷશମ૾ 9 CodePipeline CodeCommit ιʔείʔυ CodeBuild ςετϏϧυ

    CodeDeploy σϓϩΠ CodeStar
  10. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJUͷ֓ཁ 10 CodeCommit ιʔείʔυ • HJUIVC૬౰ͷαʔϏε •

    *".ϢʔβຖʹΞΫηε੍ޚͰ͖Δɻ • JTTVF؅ཧ͸ແ͍ɻ $*$%ܥαʔϏεͰҰ൪͓खܰ
  11. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJUͷڝ߹αʔϏε 11 CodeCommit ιʔείʔυ • (JU)VC •

    #JUCVDLFU • (JU)VC&OUFSQSJTF • 4
  12. Operation Lab ӡ༻ઃܭϥϘ $PEF#VJMEͷ֓ཁ 12 CodeBuild ιʔείʔυ ςετϏϧυ ΞʔςΟϑΝΫτ ੒Ռ෺

    • ιʔείʔυʹಉࠝ͞ΕͨCVJMETQFDZNMʹैͬͯ ςετ΍ϏϧυΛ࣮ߦ͢Δɻ • Ϗϧυͨ͠੒Ռ෺ ΞʔςΟϑΝΫτ ͕ग़ྗ͞ΕΔɻ ׂͱԿͰ΋Ͱ͖Δɻ ൿ఻ͷλϨԽ΋
  13. Operation Lab ӡ༻ઃܭϥϘ $PEF#VJMEͱ࿈ܞͰ͖ΔαʔϏε 13 CodeBuild ςετϏϧυ ΞʔςΟϑΝΫτ ੒Ռ෺ ιʔείʔυ

    • $PEF$PNNJU • $PEF1JQFMJOF • (JU)VC • 4 • #JU#VDLFU • (JU)VC&OUFSQSJTF • /0@4063$& • $PEF1JQFMJOF • 4 • /0@4063$& • CVJMETQFDZNMʹهड़ͨ͠৔ॴ • ྫ &$3
  14. Operation Lab ӡ༻ઃܭϥϘ $PEF%FQMPZͷ֓ཁ 14 CodeDeploy σϓϩΠ • ιʔείʔυʹಉࠝ͞ΕͨBQQTQFDZNMʹैͬͯ σϓϩΠ͢Δɻ

    • EFQMPZΤʔδΣϯτͷೖ͍ͬͯΔ&$΍ΦϯϓϨʹσϓϩΠɻ • -BNCEBͱ&$4΁ͷσϓϩΠʹ΋ରԠɻ ΞʔςΟϑΝΫτ ੒Ռ෺ • Server • Lambda • ECS ͦΕͧΕΞϓϦέʔγϣϯλΠϓ͕ҟͳΔͷͰɺޙ͔ΒมߋͰ͖ͳ͍ɻ σϓϩΠର৅͕ண࣮ʹ૿͍͑ͯΔɻ ංେԽͱ΋
  15. Operation Lab ӡ༻ઃܭϥϘ $PEF%FQMPZͱ࿈ܞͰ͖ΔαʔϏε 15 CodeDeploy σϓϩΠ ΞʔςΟϑΝΫτ ੒Ռ෺ •

    Server • Lambda • ECS • 4 • 4FSWFS &$  • 4FSWFS ΦϯϓϨ  • -BNCEB • &$4
  16. Operation Lab ӡ༻ઃܭϥϘ $PEF1JQFMJOFͷ֓ཁ 16 CodePipeline • $*$%αʔϏεΛͭͳ͙໾ׂɻ • جຊతʹ+40/Ͱߏ੒Λॻ͘ɻ

    • ϚϧνιʔεʹରԠ ೥݄  • $MPVE8BUDI&WFOUTʹରԠ ೥݄
  17. Operation Lab ӡ༻ઃܭϥϘ • S3 • ECS (Blue/Green) • ElasticBeanstalk

    • CloudFormation • OpsWorks • ServiceCatalog • Alexa skiils kit $PEF1JQFMJOFͱ࿈ܞͰ͖ΔαʔϏε 17 CodePipeline • CodeCommit • S3 • ECR • GitHub ঝೝεςοϓ • CodeBuild • Jenkins • ֤छSaaS IUUQTEPDTBXTBNB[PODPNKB@KQDPEFQJQFMJOFMBUFTUVTFSHVJEFJOUFHSBUJPOTBDUJPOUZQFIUNMJOUFHSBUJPOTUFTU
  18. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷશମ૾ 18 CodePipeline CodeCommit ιʔείʔυ CodeBuild ςετϏϧυ

    CodeDeploy σϓϩΠ CodeStar ͜ΕΒΛ૊Έ߹Θͤͯ$*$%ύΠϓϥΠϯΛ૊Ή
  19. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷਖ਼͍͠࢖͍ํ 19 ͜ΕΒΛ૊Έ߹Θͤͯ$*$%ύΠϓϥΠϯΛ૊Ή πʔϧʹࣗ෼ୡΛ߹ΘͤΔͷͰ͸ͳ͘ ࣗ෼ୡͷύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ΜͰ͢Α 4"େଜ͞Μ

    ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ
  20. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷਖ਼͍͠શମ૾ 20 CodePipeline CodeCommit ιʔείʔυ CodeBuild ςετϏϧυ

    CodeDeploy σϓϩΠ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ໨త खஈ ࣗ෼ͨͪͷύΠϓϥΠϯ
  21. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ 21

  22. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ 22 ιʔείʔυ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ σϓϩΠઌ ੒Ռ෺

    Ϧιʔε Ϧιʔε Ϧιʔε Ϧιʔε ੒Ռ෺ ఏڙऀ Ϣʔβ ςετϏϧυ σϓϩΠ ੒Ռ෺ ੒Ռ෺
  23. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ 23 ιʔείʔυ ςετϏϧυ σϓϩΠ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ σϓϩΠઌ

    ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ఏڙऀ Ϣʔβ • $PEF$PNNJU • 4 • &$3 • (JU)VC • #JU#VDLFU • (JU)VC&OUFSQSJTF • /0@4063$& • $PEF#VJME • +FOLJOT • ֤छ4BB4 • $PEF%FQMPZ • TDQͳͲ • $BQJTUSBOPͳͲ • &$ • ΦϯϓϨ • &$4 • 'BSHBUF • -BNCEB • &$4 #MVF(SFFO  • &MBTUJD#FBOTUBML • 0QT8PSLT • $MPVE'PSNBUJPO • 4FSWJDF$BUBMPH • "MFYBTLJJMTLJU
  24. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓͰେࣄͳࣄ 24 πʔϧ͸ԿͰ΋ྑ͍͠ɺ࣌୅ͰมΘΔ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ ఏڙऀ Ϣʔβ ιʔείʔυ

    ςετϏϧυ σϓϩΠ σϓϩΠઌ ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ੒Ռ෺
  25. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ͔Βݟ͑ͯ͘Δܗ 25

  26. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ 26 ιʔείʔυ ςετϏϧυ σϓϩΠ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ σϓϩΠઌ

    ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ఏڙऀ Ϣʔβ ΞʔςΟϑΝΫτ ;JQ தؒ੒Ռ෺ • $PEF$PNNJU • 4 • &$3 • (JU)VC • #JU#VDLFU • (JU)VC&OUFSQSJTF • /0@4063$& • $PEF%FQMPZ • TDQͳͲ • $BQJTUSBOPͳͲ • &$ • ΦϯϓϨ • &$4 • 'BSHBUF • -BNCEB • &$4 #MVF(SFFO  • &MBTUJD#FBOTUBML • 0QT8PSLT • $MPVE'PSNBUJPO • 4FSWJDF$BUBMPH • "MFYBTLJJMTLJU • $PEF#VJME • +FOLJOT • ֤छ4BB4
  27. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJU $PEF1JQFMJOF 4 27 ιʔείʔυ ςετϏϧυ σϓϩΠ

    σϓϩΠઌ ੒Ռ෺ ੒Ռ෺ ఏڙऀ Ϣʔβ CodePipeline ୯७ͳ্ॻ͖ͳͷͰɺҠಈ΍࡟আʹ͸௥ਵͰ͖ͳ͍ɻ • 4 • 4 • 4 Tutorial: Create a Pipeline That Uses Amazon S3 as a Deployment Provider IUUQTEPDTBXTBNB[PODPNKB@KQDPEFQJQFMJOFMBUFTUVTFSHVJEFUVUPSJBMTTEFQMPZIUNM தؒ੒Ռ෺ WebSite Hosting
  28. ࠓޙͷٞ࿦ωλ Ұ෦ • ίϯύΠϧͱඇίϯύΠϧͰҧ͍͕͋Γͦ͏ • $44΍ϑϩϯτ΋ίϯύΠϧ͢ΔΑͶ  • ".*Λར༻ͨ͠σϓϩΠ͸Ͳ͏΍Δ Operation

    Lab ӡ༻ઃܭϥϘ 28
  29. Operation Lab ӡ༻ઃܭϥϘ ࠓ೔͔Β͸͡ΊΔ$*$% 29

  30. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓΛ࡞Ζ͏ 30 ࣗ෼ୡͷύΠϓϥΠϯΛ ͪΌΜͱ࿦ཧతʹઆ໌Ͱ͖Δਓ͸ গͳ͍ΜͰ͢Α 4"େଜ͞Μ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ

    ࣗ෼ୡͷ$*$%ύΠϓϥΠϯ૾Λ٬؍Խɾߏ଄Խ͢Δ ͦͷલʹ
  31. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓΛ࡞Ζ͏ 31 ιʔείʔυ ςετϏϧυ σϓϩΠ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ

    σϓϩΠઌ ੒Ռ෺ Ϧιʔε Ϧιʔε Ϧιʔε Ϧιʔε ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ఏڙऀ Ϣʔβ
  32. Operation Lab ӡ༻ઃܭϥϘ 32 IUUQXXXPQFSBUJPOMBCDPKQ OperationLab ӡ༻ઃܭ