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.
    ҟͳΔࢥ૝Ͱॻ͔Εͨίʔυͷ౷
    Ұʹಈ͘


    -Terraformͷ৔߹-
    γεςϜϓϥοτϑΥʔϜ෦ ΠϯϑϥɾSREνʔϜ TeamManager


    ٢઒୓ݟ

    View full-size slide

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


    ● ߏ੒౷Ұʹ޲͚ͯϙΠϯτͩͱࢥ͏఺Λ؆୯ʹ঺հ͢Δ


    ● ঺հ͖͠Εͳ͍͜ͱ͸ϒϩάΛࢀর͍͖͍ͨͩͨ


    ○ https://zenn.dev/coconala/articles/7a49fee9893c95


    ○ ʮzenn ίίφϥ terraformʯͰݕࡧ

    View full-size slide

  3. Copyright coconala Inc. All Rights Reserved.
    3
    ͲΜͳίʔυͩͬͨͷ͔ʁ

    View full-size slide

  4. Copyright coconala Inc. All Rights Reserved.
    4
    ΄Μͱ͏ʹ͋ͬͨා͍ίʔυʢҰ෦ʣ
    ɾ࣮૷ͨ࣌͠΋୲౰ऀ΋όϥόϥ


    → ͦͷͨΊ͓ͷ͓ͷͷࢥ͏ߏ੒͕ݱࡏ·Ͱ࢒ͬͨ


    ɾ໋໊༳Ε͕ଟ͍


    → module/awsͳͷ͔aws/moduleͳͷ͔


    ɾmoduleͱͯ͠࡞੒͍ͯ͠Δ͕த਎͸resource͕1ͭ͋Δ͚ͩͱ͍͏͜ͱ
    ͕··͋Δ


    → moduleͷ༗༻ੑ͕Θ͔Βͣʹ࣮૷͞Ε͍ͯΔ


    ɾಉ͡ίʔυ͕module֎ʹ΋هड़͞Ε͍ͯͯɺmoduleͷςΠΛͳ͍ͯ͠ͳ
    ͔ͬͨ


    → ෆཁͳίʔυ͕ٯʹࠞཚΛট͍ͨ

    View full-size slide

  5. Copyright coconala Inc. All Rights Reserved.
    5
    ౷Ұʹ޲͚ͯͷϙΠϯτ

    View full-size slide

  6. Copyright coconala Inc. All Rights Reserved.
    6
    ౷Ұʹ޲͚ͯͷ3ͭͷϙΠϯτ
    ● σΟϨΫτϦߏ଄Λ੔ཧ͢Δ


    ○ ҙຯͷ͋Δߏ੒ΛͱΔ


    ● ෳ਺ճॻ͍ͨͱࢥ͏͜ͱ͸ڞ௨moduleԽ͢Δ


    ○ Ͱ͖ΔϨϕϧ͔ΒͰ΋࢝ΊΔ


    ● ϨϏϡʔΛ௨࣮ͯ͠૷ऀͷҙࣝΛ͋ΘͤΔ


    ○ [Q] Λ্खʹ࢖͏

    View full-size slide

  7. Copyright coconala Inc. All Rights Reserved.
    7
    σΟϨΫτϦߏ଄Λ੔ཧ͢Δ
    ɾεςʔτϑΝΠϧΛͲͷΑ͏ʹ෼͚Δ͔Λ
    ߟ͑Δ


    ɾαʔϏε / module ϨϕϧͰಉ༷ͷߏ੒Λ
    ͱΔΑ͏ʹ͢Δ


    ɾਖ਼ղ͸ͳ͘ɺ౎౓ߏ଄มߋΛߟ͑Δ


    ɾ৽ن࡞੒͔Βద༻͠ɺաڈͷ΋ͷ͸ਵ࣌
    Ҡߦ͍ͯ͘͠
    ·ͣ͸ҙਤͷ͋Δ౷Ұతͳߏ੒ΛͱΖ͏ͱ͢Δ࢟੎Λେ੾ʹʂʂ

    View full-size slide

  8. Copyright coconala Inc. All Rights Reserved.
    8
    ෳ਺ճॻ͍ͨͱࢥ͏͜ͱ͸ڞ௨moduleԽ͢Δ
    ɾαʔϏε͝ͱʹ؅ཧϦϙδτϦɾAWSΞΧ΢ϯτΛ෼
    ཭͍ͯ͠Δ


    ɾ৽αʔϏεΛཱͯΔͱ͖ʹVPC΍RDSͳͲɺಉ͡Α͏
    ͳ΋ͷͷίʔυΛϓϦηοτͱ͍ͯ͠Δؾ͕ͨ͠


    → ڞ௨moduleʹҠಈ


    ɾ·ͣ͸৽ཱͯ͘͠ΔαʔϏεΛڞ௨module΁


    ɾطଘαʔϏε෼ΛimportͰҠ২


    ɾmodule͸ΧϯϖΩͰ͋Δඞཁ͸ͳ͍

    View full-size slide

  9. Copyright coconala Inc. All Rights Reserved.
    9
    ϨϏϡʔΛ௨࣮ͯ͠૷ऀͷҙࣝΛ͋ΘͤΔ


    ɾ[Q]ͷϨϕϧ͸໰Θͳ͍ɺͱʹ͔ٙ͘໰఺͸
    ฉ͍ͯΈΔ


    ɾࣗݾϨϏϡʔͷ৔ͱͯ͠΋هࡌ͢Δ


    → ϨϏϡΞʔ΋ͲͷΑ͏ͳҙਤͳͷ͔ཧղ͠
    ΍͍͢

    View full-size slide

  10. Copyright coconala Inc. All Rights Reserved.
    10
    ͍͞͝ʹ
    ● Ͱ͖Δͱ͜Ζ͔ΒऔΓ૊ΜͰ͍͕͘ҙ֎ͱେ੾


    ● νʔϜɾάϧʔϓશମͷϨϕϧ޲্΋͸͔Δඞཁ͕͋Δ


    ● ঺հͨ͠औΓ૊Έ͸ҰྫͰɺ߹͏ͱ͜Ζͱ߹Θͳ͍ͱ͜Ζ͕͋Δ


    ● ঺հ͖͠Εͳ͍͜ͱ͸ϒϩάΛࢀর͍͖͍ͨͩͨʢେࣄͳ͜ͱͳͷͰ̎ճ໨ʣ


    ○ https://zenn.dev/coconala/articles/7a49fee9893c95


    ○ ʮzenn ίίφϥ terraformʯͰݕࡧ

    View full-size slide

  11. 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

    View full-size slide