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

異なる思想で書かれたコードの統一に動く -Terraformの場合-

異なる思想で書かれたコードの統一に動く -Terraformの場合-

2023/11/21 FindyイベントでのLT内容です。
イベントページ:https://findy.connpass.com/event/297813/
関連ブログ:https://zenn.dev/coconala/articles/7a49fee9893c95

coconala_engineer

November 21, 2023
Tweet

More Decks by coconala_engineer

Other Decks in Technology

Transcript

  1. Copyright coconala Inc. All Rights Reserved. 2 ຊ೔ͷ֓ཁ • ೥݄ΛܦΔ&༷ʑͳਓͨͪͰӡ༻͍ͯ͠ΔͱΠϯϑϥίʔυ͸Ԛ͘ͳΔ

    • ߏ੒౷Ұʹ޲͚ͯϙΠϯτͩͱࢥ͏఺Λ؆୯ʹ঺հ͢Δ • ঺հ͖͠Εͳ͍͜ͱ͸ϒϩάΛࢀর͍͖͍ͨͩͨ ◦ https://zenn.dev/coconala/articles/7a49fee9893c95 ◦ ʮzenn ίίφϥ terraformʯͰݕࡧ
  2. Copyright coconala Inc. All Rights Reserved. 4 ΄Μͱ͏ʹ͋ͬͨා͍ίʔυʢҰ෦ʣ ɾ࣮૷ͨ࣌͠΋୲౰ऀ΋όϥόϥ →

    ͦͷͨΊ͓ͷ͓ͷͷࢥ͏ߏ੒͕ݱࡏ·Ͱ࢒ͬͨ ɾ໋໊༳Ε͕ଟ͍ → module/awsͳͷ͔aws/moduleͳͷ͔ ɾmoduleͱͯ͠࡞੒͍ͯ͠Δ͕த਎͸resource͕1ͭ͋Δ͚ͩͱ͍͏͜ͱ ͕··͋Δ → moduleͷ༗༻ੑ͕Θ͔Βͣʹ࣮૷͞Ε͍ͯΔ ɾಉ͡ίʔυ͕module֎ʹ΋هड़͞Ε͍ͯͯɺmoduleͷςΠΛͳ͍ͯ͠ͳ ͔ͬͨ → ෆཁͳίʔυ͕ٯʹࠞཚΛট͍ͨ
  3. Copyright coconala Inc. All Rights Reserved. 6 ౷Ұʹ޲͚ͯͷ3ͭͷϙΠϯτ • σΟϨΫτϦߏ଄Λ੔ཧ͢Δ

    ◦ ҙຯͷ͋Δߏ੒ΛͱΔ • ෳ਺ճॻ͍ͨͱࢥ͏͜ͱ͸ڞ௨moduleԽ͢Δ ◦ Ͱ͖ΔϨϕϧ͔ΒͰ΋࢝ΊΔ • ϨϏϡʔΛ௨࣮ͯ͠૷ऀͷҙࣝΛ͋ΘͤΔ ◦ [Q] Λ্खʹ࢖͏
  4. Copyright coconala Inc. All Rights Reserved. 7 σΟϨΫτϦߏ଄Λ੔ཧ͢Δ ɾεςʔτϑΝΠϧΛͲͷΑ͏ʹ෼͚Δ͔Λ ߟ͑Δ

    ɾαʔϏε / module ϨϕϧͰಉ༷ͷߏ੒Λ ͱΔΑ͏ʹ͢Δ ɾਖ਼ղ͸ͳ͘ɺ౎౓ߏ଄มߋΛߟ͑Δ ɾ৽ن࡞੒͔Βద༻͠ɺաڈͷ΋ͷ͸ਵ࣌ Ҡߦ͍ͯ͘͠ ·ͣ͸ҙਤͷ͋Δ౷Ұతͳߏ੒ΛͱΖ͏ͱ͢Δ࢟੎Λେ੾ʹʂʂ
  5. Copyright coconala Inc. All Rights Reserved. 8 ෳ਺ճॻ͍ͨͱࢥ͏͜ͱ͸ڞ௨moduleԽ͢Δ ɾαʔϏε͝ͱʹ؅ཧϦϙδτϦɾAWSΞΧ΢ϯτΛ෼ ཭͍ͯ͠Δ

    ɾ৽αʔϏεΛཱͯΔͱ͖ʹVPC΍RDSͳͲɺಉ͡Α͏ ͳ΋ͷͷίʔυΛϓϦηοτͱ͍ͯ͠Δؾ͕ͨ͠ → ڞ௨moduleʹҠಈ ɾ·ͣ͸৽ཱͯ͘͠ΔαʔϏεΛڞ௨module΁ ɾطଘαʔϏε෼ΛimportͰҠ২ ɾmodule͸ΧϯϖΩͰ͋Δඞཁ͸ͳ͍
  6. Copyright coconala Inc. All Rights Reserved. 10 ͍͞͝ʹ • Ͱ͖Δͱ͜Ζ͔ΒऔΓ૊ΜͰ͍͕͘ҙ֎ͱେ੾

    • νʔϜɾάϧʔϓશମͷϨϕϧ޲্΋͸͔Δඞཁ͕͋Δ • ঺հͨ͠औΓ૊Έ͸ҰྫͰɺ߹͏ͱ͜Ζͱ߹Θͳ͍ͱ͜Ζ͕͋Δ • ঺հ͖͠Εͳ͍͜ͱ͸ϒϩάΛࢀর͍͖͍ͨͩͨʢେࣄͳ͜ͱͳͷͰ̎ճ໨ʣ ◦ https://zenn.dev/coconala/articles/7a49fee9893c95 ◦ ʮzenn ίίφϥ terraformʯͰݕࡧ
  7. Copyright coconala Inc. All Rights Reserved. 11 ίίφϥ ΤϯδχΞͷX(Twitter) X

    /Twitterʢ@coconala_engʣ https://twitter.com/coconala_eng ஥ؒΛืूதͰ͢ʂʂ ࠾༻ϗʔϜϖʔδ https://coconala.co.jp/recruit ΤϯδχΞ࠾༻ϗʔϜϖʔδ https://coconala.co.jp/recruit/engineer ίίφϥͷਓͱ૊৫Λ఻͑Δϒϩά ίίφϥLIVE https://blog.coconala.co.jp/m/m4e4abe8b17e5 ਓੜͷՄೳੑΛ޿͛ͨϢʔβʔετʔϦʔ Θͨ͠ͷεΩϧղ์ه https://blog.coconala.co.jp/m/me8a586112ad2 ίίφϥʹॴଐ͢ΔΤϯδχΞʹΑΔϒϩά ςοΫϒϩά https://zenn.dev/coconala