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

확장 가능한 테라폼 코드 관리 (Scalable Terraform Code Management)

확장 가능한 테라폼 코드 관리 (Scalable Terraform Code Management)

회사의 성장에 따라 관리하는 인프라의 규모도 함께 성장합니다. 이에 따라 테라폼의 코드는 점점 거대해지고 복잡해집니다. 어떻게 하면 테라폼 코드를 유연하게 확장시켜 나가며 관리할 수 있을지에 대한 노하우를 공유합니다.

330c5e37fb238d6b319ae6e18770f44b?s=128

Byungjin Park

May 02, 2022
Tweet

More Decks by Byungjin Park

Other Decks in Programming

Transcript

  1. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. Scalable Terraform Code Management ഛ੢ оמೠ పۄಬ ௏٘ ҙܻ ߅ ߽૓ (Byungjin Park) · ௿۽٘ (Claud) · Site Reliability Engineer @ ׼Ӕಕ੉ HashiTalks: Korea April 28, 2022
  2. speaker ߊ಴੗ ࣗѐ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ߅߽૓ / @posquit0 / ௿۽٘ (Claud) (അ) Site Reliability Engineer @ ׼Ӕಕ੉ (੹) Director of Infrastructure Division @ ஠ࢎ௏ܻই (੹) Software Architect @ ১פযझ 
 (੹) Co-founder & Software Engineer @ ஠೒ۖ HashiCorp Ambassador / AWS Community Builder 
 Ҵઁ೧ఊ؀ഥ DEFCON CTF ࠄࢶ 6ഥ ૓୹ ೞद௏೐ ೠҴ ࢎਊ੗ ݽ੐ ਍৔ ೠҴ੄ য়೑ࣗझ ઺ GitHub 15,000ѐ ੉࢚੄ झఋܳ ߉਷ ೐۽ં౟
  3. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. intro
  4. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. Objective intro “ઑ૒੉ ழ૑ݶࢲ ҙܻೞח పۄಬ ௏٘о ੼੼ ࠂ੟೧૑Ҋ ੓যਃ.” “ޖट పۄಬ ݽٕਸ ٜ݅Ҋ যڌѱ ҙܻ೧ঠೡ૑ х੉ উ৬ਃ.” “ب؀୓ ೞա੄ పۄಬ ਕ௼झಕ੉झী ׸ইঠ ೞח ܻࣗझ੄ ҃҅ח য٣ө૑ੌөਃ?” “઺ࠂغח పۄಬ ௏٘о ցޖ ݆ই૑Ҋ ੓যਃ.” ਤ৬ э਷ Ҋ޹ਸ ೞҊ ੓׮ݶ ઁо ҕਬ ܻ٘ח ղਊ੉ ೧Ѿ଼ਸ ଺ח җ੿ী ب਑੉ ؼ Ѫ੉ۄ ࢤп೤פ׮. ޛۿ ੷ب زੌೠ Ҋ޹ਸ ҅ࣘ ೞҊ ੓যਃ. ࠄ ߊ಴ ղਊ਷ ੿׹੉ ইצ ઁо పۄಬ ௏٘ܳ ؀ೞח ੗ࣁੑפ׮. 😄
  5. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. Subject intro పۄಬ بҳ৬ ӝࠄ ޙߨী ؀೧ ੉೧ೞҊ ੓׮. ࠄ ߊ಴ ղਊਸ ੉೧ೞӝ ਤ೧ࢲח ӝࠄ੸ੋ పۄಬ بҳ৬ ޙߨী ؀ೠ ੉೧ܳ ೙ਃ۽ ೤פ׮.
  6. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. Agenda intro ഛ੢ оמೠ పۄಬ ௏٘ ҙܻܳ ਤೠ ਗ஗ పۄಬ ߡ੹ ҙܻ੗ పۄಬ ௿ۄ਋٘ MISC పۄಬ ݽٕਸ ࢎਊೞۄ ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ ݽٕ੄ ߡ੹ਸ ҙܻೞۄ ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ ೞա੄ ਕ௼झಕ੉झী ݽٚ Ѫਸ ׸૑ ݃ۄ ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ೞ૑ ݃ۄ
  7. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ഛ੢ оמೠ ௏٘…?
  8. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ഛ੢ оמೠ ௏٘…? ੍যঠ ೞח ௏٘੄ ন੉ ੸׮ ࣻ੿೧ঠ ೞח ௏٘੄ ন੉ ੸׮
  9. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ഛ੢ оמೠ ௏٘…? ੍যঠ ೞח ௏٘੄ ন੉ ੸׮ ࣻ੿೧ঠ ೞח ௏٘੄ ন੉ ੸׮ ਬ૑ࠁࣻ оةࢿ
  10. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. పۄಬ ݽٕਸ ࢎਊೞۄ
  11. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕ਷ ޖ঺ੋо? ৈ۞ పۄಬ ܻࣗझܳ ೞա੄ ֤ܻ੸ Ӓܛਵ۽ ҙܻೞӝ ਤ೧ ࢎਊ ೞա੄ ٣۩షܻ ղী .tf ഑਷ .tf.json ౵ੌ۽ ҳࢿػ ௒۩࣌ ݽٕ (Module)
  12. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕ਷ ޖ঺ੋо? పۄಬ CLI о plan / apply पઁ۽ ࣻ೯ೞѱ غח ੘স ٣۩షܻ੄ పۄಬ ௏٘ ݽ਺ ܖ౟ ݽٕ (Root Module) ରੌ٘ ݽٕ (Child Module) ׮ܲ ݽٕ੄ పۄಬ ௏٘ ղীࢲ ഐ୹(ଵઑ)ೞӝ ਤೠ ݾ੸ਵ۽ ੘ࢿػ పۄಬ ௏٘ ݽ਺ ಞ੄࢚ খਵ۽ ঱әೞח ݽٚ ݽٕ਷ ରੌ٘ ݽٕਸ ੄޷೧ਃ. ഐ୹
  13. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕ ׮ܲ ݽٕ੄ పۄಬ ௏٘ ղীࢲ ഐ୹(ଵઑ)ೞӝ ਤೠ ݾ੸ਵ۽ ੘ࢿػ పۄಬ ௏٘ ݽ਺ పۄಬ ޙߨীࢲ module ࠶۾ਸ ా೧ ഐ୹ೞѱ غח పۄಬ ௏٘ పۄಬ ݽٕ ޙߨਸ ੉ਊೞݶ ৈ۞ ܻࣗझܳ ೠ ߣী औѱ ҙܻೡ ࣻ ੓যਃ. ࢤࢿ
  14. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕਸ ࢎਊ೧ঠ ೞח ੉ਬ: ઺୏ ܖ೐ (Nested Loop) aws_iam_user aws_iam_user_group_membership aws_iam_user_policy_attachment 0..1 1 1 0..N AWS ࢎਊ੗৬ ҙ۲ػ ܻࣗझٜ੄ ઙܨ৬ ܻࣗझ р੄ ҙ҅ܳ ౵ঈ೧ঠ ೧ਃ పۄಬਵ۽ AWS ࢎਊ੗ܳ ҙܻೠ׮Ҋ о੿೧ࠅѱਃ
  15. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕਸ ࢎਊ೧ঠ ೞח ੉ਬ: ઺୏ ܖ೐ (Nested Loop) aws_iam_user ܻࣗझী ؀೧ࢲ݅ ܳ for_eachա countܳ ా೧ ߈ࠂ੸ਵ۽ ҙܻೞب۾ ೞח Ѫ਷ एਕਃ aws_iam_user aws_iam_user_group_membership aws_iam_user_policy_attachment 0..1 1 1 0..N
  16. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕਸ ࢎਊ೧ঠ ೞח ੉ਬ: ઺୏ ܖ೐ (Nested Loop) aws_iam_user ܻࣗझ৬ 1:1 ҙ҅ܳ о૑ח ܻࣗझب ߹ ޙઁо غ૑ ঋભ aws_iam_user aws_iam_user_group_membership aws_iam_user_policy_attachment 0..1 1 1 0..N
  17. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕਸ ࢎਊ೧ঠ ೞח ੉ਬ: ઺୏ ܖ೐ (Nested Loop) aws_iam_user aws_iam_user_group_membership aws_iam_user_policy_attachment 0..1 1 1 0..N aws_iam_user ܻࣗझ৬ 1:N ҙ҅ܳ о૑ח ܻࣗझо ੓׮ݶ Ҏ஖ ই౵૘פ׮. https://www.daveperrett.com/articles/2021/08/19/nested-for-each-with-terraform/ 🤪 🤪
  18. module x N పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂

    posquit0.com · posquit0 Copyright © 2022 All Rights Reserved. పۄಬ ݽٕਸ ࢎਊ೧ঠ ೞח ੉ਬ: ઺୏ ܖ೐ (Nested Loop) aws_iam_user aws_iam_user_group_membership aws_iam_user_policy_attachment 0..1 1 1 0..N ݃਺੄ ಣചܳ غ଺ਸ ࣻ ੓णפ׮… 😇 🥳 ݽٕਸ ࢎਊೞѱ غݶ ࠂ੟ೠ ё୓(ܻࣗझ ૘೤)ਸ ױࣽೞѱ ҙܻೡ ࣻ ੓Ҋ,
  19. పۄಬ ݽٕਸ ࢎਊೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. పۄಬ ݽٕਸ ࢎਊ೧ঠ ೞח ੉ਬ: ஭ङച (Encapsulation) ё୓૑ೱ ೐۽Ӓ۔੄ ೨ब ѐ֛ ઺ ೞա ё୓੄ ਽૘ب৬ ة݀ࢿਸ ֫੉ӝ ਤ೧ ё୓੄ ݽٕചܳ ૑ೱೞח Ѫ ё୓੄ ݽٕചо ੜ ੉ܖয૑ݶ ݽٕ ױਤ੄ ੤ࢎਊ੉ ݒ਋ ਊ੉ ஭ङച (Encapsulation) secrets-manager-secret aws_secretsmanager_secret aws_secretsmanager_secret_policy aws_secretsmanager_secret_rotation aws_secretsmanager_secret_version aws_secretsmanager_secret_version aws_secretsmanager_secret_version рಞೠ ਬ૑ࠁࣻ!!
  20. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ
  21. ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. పۄಬ ۨ૑झ౟ܻ ೞद௏೐ীࢲ ҕध੸ਵ۽ ਍৔ೞח పۄಬ ೐۽߄੉؊ ߂ ݽٕ ੷੢ࣗ ҕѐػ పۄಬ ݽٕਸ औѱ ଺ই ഝਊೡ ࣻ ੓਺ పۄಬ ۨ૑झ౟ܻ (Terraform Registry) https://registry.terraform.io/browse/modules
  22. ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ৻ࠗী ҕѐػ పۄಬ ݽٕ о੢ ݆਷ ੋӝܳ ՑҊ ੓ח AWS పۄಬ ݽٕਸ ҙܻೞח GitHub ઑ૒ HashiCorp Ambassador ઺ ೠ ݺੋ Anton Babenkoо ܻ٘ GitHub: terraform-aws-modules https://github.com/terraform-aws-modules/ DevOps ੹ޙ ӝস Cloud Posseীࢲ ઁҕೞח పۄಬ ݽٕ GitHub: Cloud Posse https://github.com/cloudposse/ ߊ಴੗о ৈ۞ పۄಬ ݽٕਸ য়೑ࣗझ۽ ҙܻೞҊ ੓ח GitHub ઑ૒ 😄 GitHub: Tedilabs https://github.com/tedilabs/ GitHub ۨನ૑షܻী ⭐ח ௾ ൨੉ ؾפ׮. 🤣
  23. ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ޙઁ੼ ৻ࠗ੄ పۄಬ ݽٕਸ ߄۽ ࢎਊೞѱ ؼ ҃਋, ௏٘੄ ాઁӂ੉ ઑ૒ ղী হয ৈ۞ ޙઁܳ ѻਸ ࣻ ੓णפ׮. ݽٕী बпೠ ࠁউ ޙઁ੼ਸ ଺ই ׼੢ Ҋ୛ঠ ೠ׮ݶ? AWS ೐۽߄੉؊ नӏ ߡ੹ীࢲ ୶оػ ӝמਸ ੸ਊೞҊ र਷ؘ, 
 ݽٕ ղী ୶࢚ച غয Ѥٜ ࣻо হ׮ݶ? ܻࣗझীࢲח ૑ਗ೧઱ח ӝמ਷ؘ, ݽٕীࢲ ೧׼ ӝמী ؀ೠ 
 ੋఠಕ੉झܳ ઁҕ೧઱૑ ঋҊ ੓׮ݶ?
  24. ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ೧Ѿ଼ పۄಬ ݽٕਸ ૒੽ ੘ࢿೞѢա, ৻ࠗ ݽٕ੄ ࠂઁࠄਸ ࢎਊೞৈ ௏٘੄ ాઁӂਸ ઑ૒ীࢲ о૑Ҋ ੓যঠ ೤פ׮. ઑ૒ ղীࢲ ૒੽ పۄಬ ݽٕਸ ࢸ҅ೞҊ ੘ࢿೞৈ ҙܻ DIY (Do It Your Self) ৻ࠗ ݽٕਸ ࢎਊೞҊ੗ ೠ׮ݶ ઑ૒ ղࠗী ࠂઁ റ ࢎਊ Use After Fork
  25. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ
  26. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ۽ஸ ݽٕ పۄಬ ݽٕਸ ۽ஸ ౵ੌ ҃۽ܳ ా೧ ࢎਊೠ׮ݶ ಞܻೞ૑݅ ݽٕ੄ ߡ੹ਸ ࢶఖೡ ࣻ হणפ׮.
  27. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ޙઁ੼ ৈ۞ ਕ௼झಕ੉झীࢲ ࢎਊ઺ੋ ۽ஸ ݽٕী ੜޅػ ࣻ੿ਸ ೠ׮ݶ যڌѱ ؼөਃ? 🤔 service-upload-dev s3-bucket service-payment-dev log-aws-cloudtrail service-payment-prod service-upload-prod Workspaces Local Module
  28. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ਗѺ ݽٕ Git, పۄಬ ۨ૑झ౟ܻ, పۄಬ ௿ۄ਋٘ ١ ਗѺ ݽٕਸ ࢎਊೠ׮ݶ ౠ੿ ߡ੹੄ ݽٕਸ ࢎਊೞب۾ ૑੿ೡ ࣻ ੓णפ׮.
  29. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ਗѺ ݽٕ п ਕ௼झಕ੉झীࢲ ਗѺ ݽٕ੄ ౠ੿ ߡ੹ਸ ࢎਊೠ׮ݶ ݽٕਸ ߸҃ೞ؊ۄب ৔ೱਸ ߉૑ ঋب۾ ೡ ࣻ ੓णפ׮. service-upload-dev s3-bucket v0.0.2 service-payment-dev log-aws-cloudtrail service-payment-prod service-upload-prod Workspaces Remote Module s3-bucket v0.0.3 s3-bucket v0.0.1
  30. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ߡ੹ ઁড ઑѤ (Version Constraint) ੉ܳ ੜ ੉ਊೞݶ ࠛ೙ਃೠ ߡ੹ ч সؘ੉౟ ࠼بࣻܳ ઴ੌ ࣻ ੓णפ׮! ݽٕ ࠶۾ ղ version ਷ ߡ੹ ઁড ઑѤ धਸ ૑ਗ೤פ׮. 1.2.0 = 1.2.0 >= 1.2.0 ~> 1.2.0 ~> 1.0 >= 1.2.0, < 2.0.0 1.2.0 ߡ੹ 1.2.0 ߡ੹ 1.2.0 ߡ੹ ੉࢚ ઺ ୭न ߡ੹ 1.2.0 ߡ੹ ੉࢚ 2.0.0 ߡ੹ ޷݅ ઺ ୭न ߡ੹ 1.2.x ߡ੹ ઺ ୭न ߡ੹ 1.x ߡ੹ ઺ ୭न ߡ੹ https://www.terraform.io/language/expressions/version-constraints
  31. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ
  32. ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. যڃ ݽٕਸ ٜ݅ Ѫੋо? ݽٕਸ ࢎਊೞӝী খࢲ, যځೠ ݽٕٜਸ ٜ݅য ਍ਊೡ૑ ੜ Ҋ޹೧ঠ ೤פ׮. DevOps A DevOps B ਋ܻ ઑ૒੄ ಴ળҗ ஶ߮࣌੉ ੸ਊػ S3 ߡఉ ݽٕਸ ٜ݅੗! খਵ۽ S3 ߡఉ੉ ೙ਃೞݶ ੉ ݽٕਸ о૑Ҋ زੌೠ ಴ળҗ ஶ߮࣌ਸ ੸ਊೡ ࣻ ੓ਸѢঠ. Ҷ੉ S3 ߡఉ੄ ݽٚ ২࣌ਸ ࢸ੿ೡ ࣻ ੓ب۾ ੗ਬبܳ ઴ ೙ਃ হ੗ա? ա઺ী ৘৻ா੉झо ߊࢤ೮ਸ ٸ ؀਽ೞӝ য۰ਕ૑ݶ যڌѱ ೧? ݽٕ੉ ӝઓ ܻࣗझ੄ ӝמਸ ઁೠदఃݶ উػ׮Ҋ ࢤп೧. 
 ӝઓ ܻࣗझ ݽ਺ਸ ਬোೞѱ ࢎਊೡ ࣻ ੓ب۾ ب৬઻ঠ૑! ਋ࢶ S3 ߡఉҗ ҙ۲ػ ܻࣗझٜ੄ ҙ҅ܳ ౵ঈ೧ࢲ ੜ ୶࢚ചػ ೞա੄ ё୓۽ ಴അೡ ࣻ ੓ب۾ ݽٕਸ ݅٘חѱ যٸ?
  33. ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. যڃ ݽٕਸ ٜ݅ Ѫੋо? ੷ח ࠁా ف о૑ ഋక੄ పۄಬ ݽٕਸ ઑ૒ ղীࢲ ҙܻೞৈ ഝਊೞҊ ੓णפ׮. झఖ (Stack) ݽٕ (Module) పۄಬ ݽٕ (Terraform Module) ӝઓ ܻࣗझٜਸ ਬ੄޷ೠ ё୓ ױਤ۽ ׮द ୶࢚ചೠ ܻࣗझ ݽ਺ ઑ૒੄ ੿ࠁܳ ׸Ҋ ੓૑ ঋب۾ ೠ׮ যځೠ ઑ૒ীࢲٚ ਊبী ޖҙೞѱ ੤ࢎਊೞӝ औب۾ ೞח Ѫ੉ ݾ੸ ݽٕ (Module) ઑ૒੄ ӝࣿ ಴ળҗ ஶ߮࣌੉ ੸ਊغয ઁೠػ ੋఠಕ੉झ݅ ઁҕೞח పۄಬ ݽٕ झఖ਷ ܻࣗझ৬ ݽٕ੄ ݽ਺ਵ۽ ҳࢿ ࢎਊ ਊب৬ ২࣌ਸ ઁೠೞৈ ࢎਊࢿਸ ೱ࢚दఃҊ ӝࣿ ಴ળਸ ъઁ ੸ਊೞח Ѫ੉ ݾ੸ झఖ (Stack)
  34. ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. ৘द: ecr-repository ecr-repository aws_ecr_repository aws_ecr_repository_policy aws_ecr_lifecycle_policy ecr-repository AWS Resources Module Stack ۨನ૑షܻ ੿଼ ࢸ੿ ੗ਬ ੉޷૑ ۄ੉೐ࢎ੉௿ ੿଼ ࢸ੿ ੗ਬ ۨನ૑షܻ ੿଼ ࢸ੿ ઁೠ੸ ࢸ੿ ೲਊ 
 (IAM Policy Deny ੿଼ਵ۽ ӂೠ ઁೠ) 
 ੉޷૑ ۄ੉೐ࢎ੉௿ ੿଼ ࢸ੿ ࠛо 
 (޷ܻ ࢸ੿ػ ۄ੉೐ࢎ੉௿ ੿଼)
  35. ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. ৘द: micro-backend ecr-repository micro-backend Module Stack ߔূ٘ ݃੉௼۽ࢲ࠺झ ੋ೐ۄ ܻࣗझܳ ୶࢚ചೠ झఖ ࢲ࠺झ ੉ܴ, ജ҃, DB ࢎਊৈࠗ ߂ ࢸ੿, Redis ࢎਊৈࠗ ߂ ࢸ੿ ١ 
 ୭ࣗೠ੄ ২࣌݅ ੋఠಕ੉झ۽ ֢୹ eks-irsa kms-key secrets-manager-secret elasticache-redis rds-mysql kafka-topic
  36. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ
  37. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ؘ੉ఠо ೞ٘௏٬ػ ௏٘ ؘ੉ఠ৬ ௏٘о э੉ ҙܻغח ҃਋, ؘ੉ఠ ୶оܳ ਤ೧ ೦࢚ ӝઓ ࠶۾ਸ ࠂࢎ ࠢৈ֍ӝೞѱ ؾפ׮. ௏٘ ੤ࢎਊࢿ ԧ! ௏٘ ੤ࢎਊࢿ ԧ!
  38. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ௏٘ীࢲ ؘ੉ఠ ܻ࠙ೞӝ: for_each ഝਊ ௏٘ীࢲ ؘ੉ఠܳ ܻ࠙ೞӝ ਤ೧ࢲח ਋ࢶ زੌೠ ё୓ী ؀ೞৈ for_eachա countܳ ా೧ ҙܻೡ ࣻ ੓ب۾ ࣻ੿੉ ೙ਃ೤פ׮.
  39. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ௏٘ীࢲ ؘ੉ఠ ܻ࠙ೞӝ: variable ഝਊ పۄಬ੄ variableਸ ੉ਊೞৈ ؘ੉ఠח ৻ࠗ۽ࠗఠ ઱ੑ߉ਸ ࣻ ੓ب۾ ҳࢿೡ ࣻ ੓णפ׮.
  40. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. variable ۽ ୽࠙ೠо? ਕ௼झಕ੉झীࢲ ҙܻೞח ܻࣗझо ݆ই૕ࣻ۾ variableਸ ాೠ ؘ੉ఠ ઱ੑী ೠ҅ܳ ו՞פ׮. അप਷ ੼੼ ӡয૑ח variable ੿੄
  41. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. YAML۽ ؘ੉ఠ ઱ੑೞӝ ݽٚ ѐߊ੗ٜীѱ ஘ࣼೞҊ оةࢿ੉ જ਷ YAML۽ ؘ੉ఠܳ ҙܻ೧ࠅ ࣻח হਸөਃ?
  42. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. YAML۽ ؘ੉ఠ ઱ੑೞӝ ੉ઁ AWS Secrets Manager੄ द௼݁਷ ־ҳա YAML ౵ੌ ߸҃ਵ۽ ҙܻೡ ࣻ ੓ѱ غ঻णפ׮.
  43. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. try ೣࣻ…? try ೣࣻо lookup ࠁ׮ оةࢿ੉ જҊ ؊ ׮নೠ ਬૉா੉झী ੸ਊ੉ оמ೤פ׮. ࢤࣗೠؘ? try-catch ੋо? ੐੄ ӡ੉੄ ੋ੗ ੹׳ оמ ࣽࢲ؀۽ ੋ੗ ಴അध(argument expression)ਸ ೧ࢳ 
 য়ܨо ߊࢤೞ૑ ঋח ୐ ߣ૩ ੋ੗ чਸ ߈ജ try(arg 1, arg 2, …, arg N) map ؘ੉ఠীࢲ ౠ੿ keyী ೧׼ೞח valueܳ ߈ജ ೧׼ keyо হਸ ҃਋ ӝࠄ ч(default) ߈ജ lookup (map, key, default) ࠁా lookupਸ ݆੉ ॳ؍ؘ! try(map.key, default)
  44. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ղ஘ ӣী ೞա ؊ పۄಬ੄ template fi le ೣࣻܳ ੉ਊೞৈ YAML ౵ੌ ղ మ೒݁ ӝמਸ ഝਊೡ ࣻ ੓णפ׮. String Interpolation੉ оמೞ׮פ..!! 🫣
  45. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ Byungjin Park · ⌂ posquit0.com · posquit0

    Copyright © 2022 All Rights Reserved. ೧ೖূ٬ IaC / GitOps੄ ੢੼ਸ ೣԋ ־ܾ ࣻ ੓णפ׮. ѐߊ੗ DevOps / SRE Secret Managerী द௼݁ ೞա ୶о೧઴ ࣻ ੓ѷࣗ? con fi g.yaml ౵ੌী ೦ݾ ࣻ੿ೞৈ PR ৢܻदয় Secret Managerী द௼݁੉ ੉ઁ ೙ਃ হਵפ ઁѢ೧઱दয় con fi g.yaml ౵ੌী ೦ݾ ઁѢೞৈ PR ৢܻदয় ੉ઁ పۄಬ ௏٘ܳ ݽܰ؊ۄب ੋ೐ۄ ܻࣗझ ҙܻী औѱ ଵৈೡ ࣻ ੓Ҋ,
  46. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ೞա੄ ਕ௼झಕ੉झী ݽٚ Ѫਸ ׸૑ ݃ۄ
  47. ೞա੄ ਕ௼झಕ੉झী ݽٚ Ѫਸ ׸૑ ݃ۄ Byungjin Park · ⌂

    posquit0.com · posquit0 Copyright © 2022 All Rights Reserved. ੉৬ ҙ۲ೞৈ ׸Ҋ र਷ ղਊ੉ ցޖ ݆ই ׮਺ী ׮ܲ ӝഥ۽ ೧׼ ౵౟ ղਊਸ ׮ܖب۾ ೞѷणפ׮. ׮਺ਸ ӝ؀೧઱ࣁਃ…! 👋👋👋
  48. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ
  49. ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ਕ௼झಕ੉झ ৻ࠗ ؘ੉ఠ ഝਊ ਕ௼झಕ੉झ ৻ࠗ ؘ੉ఠܳ ഝਊೞӝ ਤೠ ߑߨਵ۽ పۄಬ਷ ؘ੉ఠ ࣗझܳ ઁҕ೤פ׮. ೐۽߄੉؊ীࢲ ઁҕೞח ؘ੉ఠ ઑഥ ݾ੸੄ ܻࣗझ (GET / LIST) 
 data ࠶۾ਸ ా೧ ੿੄ ؘ੉ఠ ࣗझ (Data Source) పۄಬ ೐۽߄੉؊ܳ ా೧ ઁҕೞח ؘ੉ఠࣗझ ৻ࠗ పۄಬ ਕ௼झಕ੉झ ࢚క ؘ੉ఠ ઑഥ ݾ੸ terraform_remote_state ؘ੉ఠ ࣗझ https://www.terraform.io/language/data-sources https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state
  50. ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ݺद੸ਵ۽ ਕ௼झಕ੉झ ੄ઓࢿ ઱ੑೞӝ YAML ࢸ੿౵ੌ੄ remote_states ೦ݾਸ ੿੄ೞח Ѫਵ۽ ೙ਃೠ ੄ઓ ਕ௼झಕ੉झܳ ઱ੑೡ ࣻ ੓णפ׮.
  51. ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ਕ௼झಕ੉झ р੄ ੄ઓ ҙ҅ ҙܻ п ਕ௼झಕ੉झо যځೠ ੄ઓبܳ о૑Ҋ ੓ח૑ ҙܻೡ ೙ਃо ੓णפ׮. network-vpc domain-cert network-lb domain-zone ৈ۞ ਕ௼झಕ੉झ۽ ܻ࠙ೞৈ ҙܻೞݶ ׼ো൤ п ਕ௼झಕ੉झ р੄ ੄ઓࢿ੉ ߊࢤೞѱ ؾפ׮.
  52. ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ Byungjin Park · ⌂ posquit0.com ·

    posquit0 Copyright © 2022 All Rights Reserved. ࣽജ ଵઑ য়ܨ ਕ௼झಕ੉झ р ҙ҅ীࢲ ࣽജ ଵઑо ߊࢤೞݶ ҙܻо ࠂ੟೧૑Ҋ, ৘࢚஖ ޅೠ ੉गܳ ݅զ ࣻ ੓ਵפ ઑब೧ঠ ೤פ׮. network-vpc domain-cert network-lb domain-zone ࣽജ(Cycle) ߊࢤ
  53. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ೞ૑ ݃ۄ
  54. ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. झझ۽ীѱ ૕ޙ೧ࠁӝ ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ח ਄ब਷ ֍য ل ೙ਃо ੓णפ׮. 😅 زੌೠ ੘সী ؀೧ ӝઓ ੘ࢿػ పۄಬ ௏٘о ੓חо? ࢜܂ѱ పۄಬ ௏٘ܳ ੘ࢿೡ݅ఀ दр੸ ৈਬо ੓חо? ୶റী زੌೠ ੘স੉ ߊࢤ೮ਸ ٸ ࣗਃ दрਸ ױ୷दெ઱חо? IaC੄ ੢੼(Audit, Code Review, Documentation ١)੉ ೧׼ ௏٘ী ؀೧ ਬബೠо? ੉޷ ׮ܲ ߑߨਵ۽ ٜ݅য૓ زੌ ܻࣗझо ੓׮ݶ ݽف పۄಬਵ۽ ݃੉Ӓۨ੉࣌ਸ ૓೯ೡ ࣻ ੓חо?
  55. ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. పۄಬ ҙܻ ܻࣗझ ࠙ܨ ղо పۄಬ ௏٘۽ ੘ࢿೞӝ द੘ೞݶ, زܐب زੌೞѱ ੘সਸ ೧ঠ ೠ׮ח Ѫਸ ੕૑ ݈ইঠ ೤פ׮. 👯👯 ೐۽߄੉؊ ࠙ܨ ܻࣗझ పۄಬ ҙܻ ৈࠗ AWS VPC VPC O AWS VPC Subnet O AWS VPC NACL X AWS Route53 HostedZone O AWS Route53 HostedZone Record X, NS / TXT ۨ௏٘݅ ҙܻ GitHub Organization Team O GitHub Repository Secret X ౱ ղী పۄಬਵ۽ ҙܻೞח ܻࣗझ ઙܨী ؀ೠ ೤੄ܳ ݅٘ח Ѫ੉ ઺ਃ೤פ׮.
  56. ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ೞ૑ ݃ۄ Byungjin Park · ⌂ posquit0.com

    · posquit0 Copyright © 2022 All Rights Reserved. పۄಬ ҙܻ ழߡܻ૑ ஏ੿ driftctl ৬ э਷ بҳܳ ੉ਊೞݶ పۄಬ ҙܻ ܻࣗझী ؀ೠ ୶੸ਸ औѱ ೡ ࣻ ੓णפ׮. పۄಬ ࢚క ؘ੉ఠ৬ पઁ ੋ೐ۄ ܻࣗझܳ ࠺Үೞৈ IaC ழߡܻ૑ ஏ੿ పۄಬ ҙܻ ܻࣗझ ઺ ৻ࠗ ߸҃ࢎ೦ ୶੸ AWS / Azure / GCP / GitHub ೐۽߄੉؊ ૑ਗ driftctl https://github.com/snyk/driftctl ੹୓ ܻࣗझ ઺ IaC (పۄಬ ௏٘)۽ ҙܻغҊ ੓ח ܻࣗझ੄ ࠺઺ IaC ழߡܻ૑
  57. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. misc
  58. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. పۄಬ ߡ੹ ҙܻ੗ misc о੢ ഝߊೞѱ ҙܻغҊ ੓ח పۄಬ ߡ੹ ҙܻ੗ tfenvࠁ׮ ׮নೠ ӝמਸ ઁҕ tfswitch https://github.com/warrensbox/terraform-switcher о੢ ݆੉ ࢎਊغח పۄಬ ߡ੹ ҙܻ੗ rbenvী ৔хਸ ߉ই ѐߊ tfenv https://github.com/tfutils/tfenv ৈ۞ పۄಬ ਕ௼झಕ੉झܳ ҙܻೠ׮ݶ పۄಬ ߡ੹ ҙܻ੗ח ೙ࣻੑפ׮. п పۄಬ ௏٘ ٣۩షܻী .terraform-version ੿੄
  59. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. పۄಬ ௿ۄ਋٘ misc https://app.terraform.io Terraform Cloud ೐ۄ੉ࡁ ೐۽߄੉؊ / ݽٕ ੷੢ࣗ ޖܐ ઁҕ ࢚క ੷੢ࣗ ޖܐ ઁҕ (Lock ӝמ ઁҕ) ౱ਗ 5ݺө૑ ޖܐ పۄಬ ௿ۄ਋٘ীࢲ ҙܻೞח ী੉੹౟ীࢲ పۄಬ ௏٘ ਗѺ प೯ Remote प೯ ݽ٘ ࢎਊ੗ ە఑ীࢲ పۄಬ ௏٘ प೯ (࢚క੷੢ࣗ݅ పۄಬ ௿ۄ਋٘ ੉ਊ) Local प೯ ݽ٘ ੸਷ ੋਗ੉ పۄಬ ௏٘ܳ ҙܻೠ׮ݶ పۄಬ ௿ۄ਋٘ܳ ࢎਊೞৈ ޖܐ۽ ׮নೠ ӝמਸ ഝਊೡ ࣻ ੓णפ׮.
  60. summary Byungjin Park · ⌂ posquit0.com · posquit0 Copyright ©

    2022 All Rights Reserved. 1. పۄಬ ݽٕਸ ࢎਊೞۄ 2. ৻ࠗ ݽٕਸ ࢎਊೞ૑ ݃ۄ 3. ݽٕ੄ ߡ੹ਸ ҙܻೞۄ 4. ف ઙܨ੄ పۄಬ ݽٕਸ ҙܻೞۄ 5. ௏٘৬ ؘ੉ఠܳ ܻ࠙ೞۄ 6. ೞա੄ ਕ௼झಕ੉झী ݽٚ Ѫਸ ׸૑ ݃ۄ 7. ਕ௼झಕ੉झ р੄ ੄ઓࢿਸ ҙܻೞۄ 8. ݽٚ Ѫਸ పۄಬਵ۽ ҙܻೞ۰ೞ૑ ݃ۄ పۄಬ ߡ੹ ҙܻ੗ܳ ࢎਊೞ੗ పۄಬ ௿ۄ਋٘ જ׮ ݃૑݄ਵ۽…
  61. ࣻಣ੸ੋ ࣗా — ૒ә X / ৔য੉ܴ / न܉৬ ୽ج

    / ైݺೠ ੿ࠁ ҕਬ ੗ਯҗ ଼੐ — מز੸ সޖ ࣻ೯ / ੗ਯ੸ ౸ױ ૌѩѱ ࢿ੢ — աࠁ׮ ڪযդ زܐ / ౱ ਕ௼ / ૌѢ਑ ࢎਊ੗ ઺ब ࢎҊ — ࢎਊ੗ о஖ ୭਋ࢶ / ࢎਊ੗৬ ੿ࢲ੸ োѾ recruiting ੋ೐ۄ ౱ীࢲ ೣԋ ೡ زܐܳ ଺ইਃ! 👋 Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022 All Rights Reserved. ੗ࣁೠ ղਊ਷ daangn.team ਸ ߑޙ೧઱ࣁਃ! :) SRE (Site Reliability Engineer) ׼Ӕಕ੉ ੋ೐ۄ ҳ୷ ߂ ਍৔ Data Engineer ׼Ӕಕ੉ ؘ੉ఠ ೒ۖಬ ҳ୷ ߂ ਍৔ ਋ܻח ੉ۧѱ ੌ೧ਃ ഌఖ ߂ ࠂ૑ ੗ਬ۽਍ ോо / ਬো ୹ృӔ ߂ ੤ఖӔޖ / धࢎ ߂ ׮নೠ рध ઁҕ झగ٬ ؘझ௼ & ೲݢ޻۞ ੄੗ ઁҕ / بࢲ ҳݒ ߂ Үਭ࠺ ૑ਗ ੗֎… ա৬ ೣԋ పۄಬ ௏٘ ӫ૑ ঋѷࣗ..? 👨🦳
  62. Byungjin Park · ⌂ posquit0.com · posquit0 Copyright © 2022

    All Rights Reserved. End of Document Visit my AMA (https://github.com/posquit0/ama) for any question!