$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
after of Infrastructure-as-Code-is-very-tired
Search
shogomuranushi
July 31, 2019
Programming
16
3.4k
after of Infrastructure-as-Code-is-very-tired
shogomuranushi
July 31, 2019
Tweet
Share
More Decks by shogomuranushi
See All by shogomuranushi
ノーコード x ChatBotで遊んでたら ReActを実装しそうだった話
shogomuranushi
0
1.2k
ChatGPT関連情報の追い方、個人・業務での使い方、サービスへの組み込み方、 ABEJAでの取り組み4例、ここ2週間のトピックなど行けるところまで
shogomuranushi
5
1.9k
FPが教える iDeCo のすごさ
shogomuranushi
0
130
AWS Control Tower導入してハッピーになりました
shogomuranushi
0
240
EKS を使ってる人から見た App Runner
shogomuranushi
7
2.4k
Suggested Topicの質問に可能な限り答えてみた
shogomuranushi
0
1.1k
顧客のアプリケーションコードが動くマルチテナント環境における課題とEKSにたどり着くまで
shogomuranushi
0
1.6k
ちょいテク100本ノック。できるまで帰しません 。今から使えるちょいテク集
shogomuranushi
1
2.7k
what is Cloud Run?
shogomuranushi
2
110
Other Decks in Programming
See All in Programming
初めてDefinitelyTypedにPRを出した話
syumai
0
480
社内活動の取り組み紹介 ~ スリーシェイクでこんな取り組みしてます ~
bells17
0
370
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
3.7k
Leveling Up Developer Tooling for the Modern Rails & Hotwire Era @ Ruby Türkiye, November 2024
marcoroth
0
150
似たもの同士のPerlとPHP
uzulla
1
100
TypeScript でバックもやるって実際どう? 実運用で困ったこと3選
yuichiro_serita
17
7k
新卒研修で作ったアプリのご紹介
mkryo
0
200
romajip: 日本の住所CSVデータを活用した英語住所変換ライブラリを作った話
sangunkang
0
2.3k
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
3k
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
140
Vue.js_好きに捧ぐ Nuxt Hub で簡単に始めるCloudflare
xiombatsg
1
100
Cursorでアプリケーションの追加開発や保守をどこまでできるか試したら得るものが多かった話
drumnistnakano
0
240
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
24k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Designing for Performance
lara
604
68k
Raft: Consensus for Rubyists
vanstee
136
6.7k
Ruby is Unlike a Banana
tanoku
97
11k
GitHub's CSS Performance
jonrohan
1030
460k
The Invisible Side of Design
smashingmag
298
50k
What's new in Ruby 2.0
geeforr
343
31k
Scaling GitHub
holman
458
140k
Transcript
Infrastructure as CodeʹർΕͨͷͰ ͕ͨͪຊདྷΓ͔ͨͬͨ͜ͱΛཧ͢Δ +α X-Tech JAWS & JAWS-UGΞʔΩςΫνϟઐࢧ෦ ίϥϘษڧձ#02
Shogo Muranushi
Shogo Muranushi ABEJA, Inc. - ABEJA Platform Product Owner -
Site Reliability Engineer Tech Lead
None
None
None
None
ΞδΣϯμ • JAWS DaysͰͨ͠༰ͷ͓͞Β͍ • ͦͷޙʹ৭ʑͳਓͱͨ݁͠ • ͡Ό͋ɺԿ͔Β࢝ΊΔʁͦͷޙͷIaCͷτϨϯυ • αΫοͱͬͯϋϚΓͦ͏ͳ݅Λ·ͱΊΔ
• ·ͱΊ
JAWS DaysͰͨ͠༰ͷ͓͞Β͍ ʢ5όʔδϣϯʣ
ࠓͷͷঢ়ଶ ύτϥογϡͷֆΛ ૾͍ͯͩ͘͠͞
ຊηογϣϯͰͷ Infrastructure as Code ओʹAWSΛߏ ͢ΔͨΊͷπʔϧ܈Λࢦ͠·͢ɻ ղΛ͍࣋ͬͯΔΘ͚Ͱ͋Γ·ͤΜɻ ϕετͳҊ͍࣋ͬͯͳ͍ͷͰΈΜͳͰ͑Λग़͠·͠ΐ ͏ɻ ҙࣄ߲
• Chef: 1 • Ansible: 2 • CloudFormation: 2 •
Terraform: 3 ͷวྺ
None
• σΟϨΫτϦઃܭ • Environment Λ͚Δ • tfstate s3 backend
ʹ • Workspace ͷ׆༻ • Map ؔϑϧ׆༻ ৄղʂTerraform Best Practices in 2017
• σΟϨΫτϦઃܭ ӨڹൣғΛݶఆ͢ΔͨΊ not_immutableͱimmutableΛ͚Δ ࠶ར༻ੑΛߴΊΔͨΊɺϦιʔεmoduleԽ͢Δ
• EnvironmentΛ͚Δ WorkspaceΛ׆༻͠ɺڥΛ͚Δ ݺͼग़࣌͢ ${terraform.workspace}
• Map ؔϑϧ׆༻ ڥຖʹϦʔδϣϯΛม͑Δྫ υοτ۠ΓͰvariableΛఆٛ
• tfstate s3 backend ʹ
None
ৄղʂTerraform Best Practices in 2017
• ࣾһͷΦϯϘʔσΟϯάʹ͕͔͔࣌ؒΔ • ϲ݄ޙʹࣗͰ࡞Δ࣌ʹࢥ͍ग़͢ͷʹ͕͔͔࣌ؒΔ • ҰఆͷεΩϧΛ͍࣋ͬͯΔਓ͕͍Δ ϕετϓϥΫςΟε͔͠Εͳ͍͚Ͳෳࡶ
• ApplyʹؾΛ͏ • Destroy/Create͠ͳ͍͔৻ॏʹͳΔ • ಈ࡞Λཧղ͍ͯ͠ͳ͍ਓʹ҆қʹ࡞ۀΛͤΒΕͳ͍ • ͭ·ΓɺҰఆͷεΩϧΛ͍࣋ͬͯΔਓ͕͍Δ มߋͷࠩΛҡ࣋͢Δͷʹख͕͔͔ؒΔ
• TerraformɺCFnͷରԠΛͯͳ͍߹खͰΔʁ • ͱ͍͏͜ͱશ෦ΛίʔυԽग़དྷͳ͍ • ରԠޙʹࠩөΛ͠ͳ͖Όɻ݁ߏؾΛ͏ΑͶ • ͭ·ΓɺҰఆͷεΩϧΛ͍࣋ͬͯΔਓ͕͍Δ ৽͍͠αʔϏεɾػೳʹରԠͯ͠ͳ͍͕࣌͋Δ
• ελʔτΞοϓͦΜͳʹਓ͕͍ͳ͔ͬͨ • ډͨͱͯ͠Value͋Δ։ൃΛͯ͠΄͍͠ ͭ·ΓɺҰఆͷεΩϧΛ͍࣋ͬͯΔਓ͕͍Δ
ΠΩϦظ ਃ͠༁͍͟͝·ͤΜɻෳࡶͰͨ͠
• ϩγΞਓʮDynamoDBͷTerraformͷίʔυΛ࡞ͬͯཉ ͍͠ʯ • ଜओʮΦοέʔʯ ͱ͋Δ
1. ·ͣSampleΛͦͷ··࣮ߦ͢Δ 2. σΟϨΫτϦઃܭ 3. EnvironmentΛ͚Δ 1. s3 backend 4.
Workspaceͷ׆༻ 1. Mapؔϑϧ׆༻ Δ͜ͱ
1. ·ͣSampleΛͦͷ··࣮ߦ͢Δ
2. σΟϨΫτϦઃܭ ӨڹൣғΛݶఆ͢ΔͨΊ not_immutableͱimmutableΛ͚Δ ࠶ར༻ੑΛߴΊΔͨΊɺϦιʔεmoduleԽ͢Δ
3. EnvironmentΛ͚Δ WorkspaceΛ׆༻͠ɺڥΛ͚Δ ݺͼग़࣌͢ ${terraform.workspace}
4. tfstate s3 backend ʹ
5. tfstate s3 backend ʹ ڥຖʹϦʔδϣϯΛม͑Δྫ υοτ۠ΓͰvariableΛఆٛ
None
None
• 1ͿΓʹTerraformΛௐΔ • forจͰ͖ͳ͍ʁʂͯ͜ͱɾɾ • Μʁ0.12Ͱforจ͕͑Δͱͳ • 0.12ΛϏϧυ͢Δ͔ʁ͍ɺ·ͱʹಈ͔ͳ͍ͷ໘ͩͳ • ΜʁTerraform
Module Registryͱ͍͏ͷ͕͋ΔͧɻGithubʹ ίʔυ্͕͕ͬͯΔ • moduleͷࢀߟʹͤͯ͞Β͓͏ ͬͱΩϨΠʹॻ͚ͳ͍ͷ͔
Terraform Module Registry
Terraform Module Registry ৺ͷ ʮ͍ɺԶ͜Μͳࣄͯ͠Δ߹͡Όͳ͍ʯ
ͷׂ Πϯϑϥ ୲ऀ Πϯϑϥ ऀ ϓϩμΫτ Φʔφʔ Time
• ʮͦΕ࡞ͬͯফͯ͠࡞ͬͯফͯ͠ɺຬߦ͘ίʔυͲΕ͘Β͍ ͷ࣌ؒͰ࡞ΕΔʁʯ • ʮ୭͕໘ݟΕΔʁʯ • ʮͦͦDynamoDBͬͯͦΜͳԿճ࡞Δʁʯ • ʮDynamoDBͷมߋ࡞ۀগͳ͘Ͷʁʯ •
ʮࠩؾʹ͠ͳ͕ΒɺίʔυͷϦϑΝΫλߟ͑ͳ͕Β͏ϝ Ϧοτ͋Δʁʯ ͦͷ࣌ͷ৺ͷू
• ʮͦ͏͍͑ɺRedshiftͷ࣌ࢥͬͨʯ • ʮSampleࢼͯ͠ɺmoduleԽͯ͠ɺΩϨΠͳίʔυʹͯ͠…ʯ • ʮͰɺRedshiftͷσϓϩΠ͕Ұճ20-30͔͔Δ͔ΒɺԿճ͔Γ ͯ͠…ʯ • ʮͦΕԿ͔͔࣌ؒΔͶΜɻϘλϯϙνϙνͰͰग़དྷΔΜʯ •
ʮdevɺstgɺprod࡞ͬͯ࡞ۀ࣌ؒ10ఔΜʯ • ʮࠩؾʹ͠ͳ͕ΒɺίʔυͷϦϑΝΫλߟ͑ͳ͕Β͏ϝϦο τ͋Δʁʯ ͦͷ࣌ͷ৺ͷू ͦͷ̎
• ʮͦ͏͍͑ɺRedshiftͷ࣌ࢥͬͨʯ • ʮSampleࢼͯ͠ɺmoduleԽͯ͠ɺΩϨΠͳίʔυʹͯ͠…ʯ • ʮͰɺRedshiftͷσϓϩΠ͕Ұճ20-30͔͔Δ͔ΒɺԿճ͔Γ ͯ͠…ʯ • ʮͦΕԿ͔͔࣌ؒΔͶΜɻϘλϯϙνϙνͰͰग़དྷΔΜʯ •
ʮdevɺstgɺprod࡞ͬͯ࡞ۀ࣌ؒ10ఔΜʯ • ʮࠩؾʹ͠ͳ͕ΒɺίʔυͷϦϑΝΫλߟ͑ͳ͕Β͏ϝϦο τ͋Δʁʯ ͦͷ࣌ͷ৺ͷू ͦͷ̎ ʮ͍ɺແཧʯ
FacebookͰᄁ͖ɺࠓʹࢸΔ
Infrastructure as CodeʹർΕͨͷͰɺ ͕ͨͪຊདྷΓ͔ͨͬͨ͜ͱΛཧ͢Δ Shogo MuranushiɹABEJA, Inc. Product Owner &
Lead Infrastructure Engineer
• Infrastructure as Codeͱ • ࣗಈԽɺόʔδϣϯཧɺςετɺܧଓతΠϯςάϨʔγϣ ϯɺܧଓతσϓϩΠͱ͍ͬͨɺιϑτΣΞ։ൃͷϓϥΫςΟ εΛγεςϜཧʹԠ༻͢ΔͨΊͷํ๏ • ݮɺ࡞ۀཤྺɺςετࣗಈԽɺΦϖϛεݮɺϨϏϡʔɾ
ϑϩʔͷϝϦοτ ͦͦ Infrastrucure as CodeͰ࣮ݱ͔ͨͬͨ͜͠ͱ
• ϙνϙνΛͰऴΘΔ͕ͣ • ίʔυԽʹ͕͔͔࣌ؒΔ • ϦϑΝΫλ͍ͨ͠ප͕ൃප͢Δ • ࠩͷ߹ΛऔΔͷʹ࣌ؒͱؾΛ͏ • ίʔυͷ֦ுੑΛ্͛ΔͱɺՄಡੑ͕Լ͕ΓෳࡶʹͳΔɻෑډ্͕͕Δ
• ίʔυͷγϯϓϧʹ͢ΔͱɺՄಡੑ্͕Δ͕֦ுੑʹ͚ܽΔ • moduleͷ࠶ར༻ੑͷ͠͞ ͨͩ͠ɺਏ͍͜ͱ͕ͨ͘͞Μ͋Δ
ߟ͑Δ͖ϙΠϯτ
• ମ੍ • ৫ • ࣄۀϑΣʔζ ͕ࣗஔ͔Ε͍ͯΔڥʹΑͬͯద༻༗ແΛߟ͑Δ େࣄ
• ʮίʔυԽਖ਼ٛʯഇࢭ͢Δ • ROIΛߟ͑ͯख࡞ۀࢹʹ ͳΜͰ͔ΜͰίʔυԽ͢ΔͷࣙΊΔ • ref:
• Φϖϛε͕͋Δ • ه͕Βͳ͍ • ࠶ݱੑ͕ͳ͍ • ͍ճͤͳ͍ • ϨϏϡʔ͕Ͱ͖ͳ͍
ख࡞ۀͰμϝͳͷ͔ɻԿ͕μϝͳͷ͔
• Φϖϛε͕͋Δ • Φϖϛεͯ͠OKͳͱ͜ΖɺNGͳͱ͜Ζ͚ͯΔʁ • ه͕Βͳ͍ • ࡞ۀ༰ɺཤྺʢExcelʣGithubͰཧ • ٯʹࠓͷঢ়ଶΛExport͍ͨ͠
• ࠶ݱੑ͕ͳ͍ • ຊʹ࠶ݱ͢Δඞཁ͋Δʁ Ҋʁ
• ͍ճͤͳ͍ • ຊʹ͍ճ͢ʁʁ • ٯʹࠓͷঢ়ଶΛExport => Import͍ͨ͠ • ϨϏϡʔ͕Ͱ͖ͳ͍
• ࡞ۀ༰ɺมߋ͢ΔύϥϝʔλΛࣄલʹϨϏϡʔ͢Δ Ҋʁ
• CLIͷίϚϯυΛهʹͯ͠ɺ࣮ߦ͢Δ • Φϖϛεগͳ͍ • هΔ • ࠶ݱੑ͋Δ • ͍ճͤΔ
• ϨϏϡʔͰ͖Δ • ႈͰͳ͍ɻએݴతͰͳ͍ Ҋʁ
ͭ·Γ
εϥϜμϯΫઋಓ͞Μ ʮ·ͩ͋ΘͯΔΑ͏ͳ࣌ؒ͡Όͳ͍ʯ
• ख࡞ۀͰԿ͕μϝͳͷ͔ɺμϝͳཧ༝Λ͏Ұચ͍ग़͢ • CLIଞͷҊ͕ग़ͯ͘Δ • ঢ়گΛؑΈͯཁ݅Λຬͨͭͭ͠ɺίετɺεϐʔυɺϦεΫΛධ Ձ͠ɺҊͷํ͕ίʔυԽΑΓROI͕ߴ͍ͳΒɺҊͰOK • ྫʣDBͱ͔CDNͬͯԿճ࡞Βͳ͍ΑͶɾɾʁ •
ίετɺεϐʔυɺϦεΫͷ؍ͰίʔυԽͷํ͕ROI͕ߴ͍ͳ ΒɺίʔυԽͰOK ʢࣗʹରͯ͠ʣྫྷ੩ʹͳΓ·͠ΐ͏
ROIΛߟ͑Δ
• ίʔυԽ͠ͳ͍ • DBͱ͔CDNͷΑ͏ͳԿճ࡞Βͳ͍Α͏ͳͭʢίετޮѱ͍ʣ • ҙਤ͠ͳ͍ಈ࡞Λڐ༰Ͱ͖ͳ͍εςʔτ࣋ͭܥʢϦεΫΛڐ༰Ͱ͖ͳ͍ʣ • Πϯϑϥͷਓ͕গͳ͍ʢֶशίετ͕͔͔ΓɺεϐʔυམͪΔʣ ίετɺεϐʔυɺϦεΫͷධՁྫ
• ίʔυԽ͢Δ • ALB + EC2 + RDBͷηοτόϯόϯ࡞ΔΜͩΑͶʔʢίετޮྑ͍ʣ • DR༻ʹ͙͢ʹ্ཱͪ͛Δඞཁ͕͋Δʢεϐʔυ͋Δʣ
• ଟϦʔδϣϯʹαʔϏεల։͢Δ͕͋Δʢεϐʔυ͋Δʣ • ϦιʔεؒΛܨ͍Ͱ͍Δܥʢίετޮߴ͍ʣ • ΦϖϛεΛՄೳͳݶΓഉআ͍ͨ͠ʢࣗಈԽʹΑΔϦεΫϔοδՄೳʣ • ͕͔ͩ͠͠ ίετɺεϐʔυɺϦεΫͷධՁྫ
• աʹΩϨΠʹ͠ա͗ͳ͍ • Γͳ͍ػೳΛิ͏ͨΊʹத͕ෳࡶͳίʔυʹϋʔυϧ্͕Δ • ඞཁ͋ΒຊՈʹPRग़ͦ͏ • ׂΓͬͯखͰྑ͍Μ ίʔυԽ͢Δ࣌ͷҙ
ࠓͷͷঢ়ଶ ͜͏ͳΒͳ͍Α͏ʹ ROIߟ͑·͠ΐ͏
ͦͷޙʹ৭ʑͳਓͱͨ݁͠
IaCͷ֓೦ྑ͍͕ʮπʔϧ͕͍͍͍ͭͯͳ͍ʯ
Infrastructure as Code IaCͷ֓೦ྑ͍͕ʮπʔϧ͕͍͍͍ͭͯͳ͍ʯ ֓೦
IaCͷ֓೦ྑ͍͕ʮπʔϧ͕͍͍͍ͭͯͳ͍ʯ Infrastructure as Code Tool ֓೦ πʔϧ
Infrastructure as Code Tool IaCͷ֓೦ྑ͍͕ʮπʔϧ͕͍͍͍ͭͯͳ͍ʯ ֓೦ πʔϧ ར ՝
Infrastructure as Code Tool IaCͷ֓೦ྑ͍͕ʮπʔϧ͕͍͍͍ͭͯͳ͍ʯ ֓೦ πʔϧ ར ՝
πʔϧ ֓೦ IaCͷ֓೦ྑ͍͕ʮπʔϧ͕͍͍͍ͭͯͳ͍ʯ Infrastructure as Code Tool ͦΕٻΊ͗ͪ͢Ό͏ʁ
ଞͷ֓೦ಉ͡ • ϚΠΫϩαʔϏεͳͲಉ͡ • ֓೦ྑ͍͚Ͳπʔϧ͕͍͍͍ͭͯͳ͍͜ͱ͕ଟ͍ • ͭ·ΓʮۜͷؙͰͳ͍ʯঢ়ଶ
Կ͕͠ΜͲ͔͔ͬͨ • πʔϧ͕ղܾͯ͘͠ΕΔ՝ͱɺπʔϧ͕͍͍͍ͭͯͳ͍෦ ΛΧόʔ͢Δγϯυ͞ • ͜ͷఱṝͷόϥϯεΛؑΈͯɺࣄۀϑΣʔζɺͷཱɺνʔϜ ମ੍ͩͱIaCγϯυ͔ͬͨ
࠾༻ɾෆ࠾༻ج४ʹ͍ͭͯ • ֓೦͕ղܾ͢Δ՝͘͢͝ଟ͍͕ɺਓͦΕͧΕ৫ஔ͔Ε͍ͯΔཱɺ ࣄۀϑΣʔζ͕ҧ͏ͨΊɺ՝ʹରͯ͠ͷॏΈ͕ҧ͏ • AgileDevOpsͷ֓೦ࣅͨΑ͏ͳͷ • ͦΕΒ͕ղܾ͢Δ՝ͱʁࠓͷࣄۀϑΣʔζɺνʔϜͷεΩϧɾମ੍ɾҾ ͖ܧ͗ͳͲɺͲ͏͍͏νʔϜʹ͍͔ͨ͠ʁͰมΘͬͯ͘Δ
৽͍ٕ͠ज़֓೦ɺࣄۀϑΣʔζɺνʔϜͷମ ੍ɺࠓޙɺͳͲΛ౿·͑ͯݕ౼͠·͠ΐ͏ νʔϜن ༏ઌ ҆ఆ༏ઌ ଐਓԽഉআ ଐਓԽͪ͠Ό͏ ಉ͡εΩϧͷਓগͳ͍ ಉ͡εΩϧͷਓଟ͍ ച্
৽͍ٕ͠ज़֓೦ɺࣄۀϑΣʔζɺνʔϜͷମ ੍ɺࠓޙɺͳͲΛ౿·͑ͯݕ౼͠·͠ΐ͏ νʔϜن ༏ઌ ҆ఆ༏ઌ ଐਓԽഉআ ଐਓԽͪ͠Ό͏ ಉ͡εΩϧͷਓগͳ͍ ಉ͡εΩϧͷਓଟ͍ ച্
ٞ͢Δͱ͖ ͜ͷลΓͷೝࣝΛ߹ΘͤΔ
ͱ͍͑ศརͳ͜ͱ͋Δ ͳͷͰɺશͯΛͦͷٕज़Ͱղܾ͢Δඞཁͳ͍
ʮશͯΛIaCͰΔඞཁͳ͍ʯ • ొஃޙ͜ͷҙݟ͕ଟ͔ͬͨ • શ෦IaCͰద༻͢ΔͷʮRDBΛࣺͯͯશͯKVSʂʯʮશ෦αʔ όϨεͰ͐ʯͱಉ͡ɻదࡐదॴ͕Ұ൪ύϑΥʔϚϯε͕ྑ͍ • freee͞ΜͷࢿྉͰʮશͯͷཁ݅ΛkubernetesͰ࣮ʯ͡Όͳ͘ ͯɺஔ͖͑Մೳͳ෦ʹ͓ͯ͘͜͠ͱɻͱ͔௨ͣΔ •
͡Ό͋ʮదࡐదॴʯΛݟ͚Δʹʁ
ٕज़ࢿɻେࣄɻઈରΔ͖
ݸਓͷ͕ձࣾͷ • ྫ͑ɺτϨϯυͷٕज़ͷ༻్ΛݟۃΊͯదࡐదॴͰ৭ʑͳαʔϏεɾπʔϧΛ Έ߹ΘͤΕແବ͕ݮΓࣄۀ͕Ճ͢Δ • AWSΛֶͿ͜ͱͰʮނোͷͨΊͷઃܭʢdesign for faillerʣʯΛֶΔ • KubernetesΛֶͿ͜ͱͰʮએݴతΞʔΩςΫνϟ͜͏͍͏͜ͱ͔ʯͱ͍͏ઃ
ܭΛֶΔɺͳͲ • ͦΕͳΒɺࣄۀΛͤ͞Δ্Ͱ৽͍ٕ͠ज़֓೦ͷशಘʢࢿʣඞਢ • ୭͔͚ͩ৽͍͜͠ͱΛֶͿͷଞ͕͍ͯ͜ͳ͍͔͠Εͳ͍ͷͰɺνʔϜͰͦ ΕͧΕٕज़Λֶͼ߹͍ɺ͓ޓ͍Ͱڞ༗͋͠͏ͷ͋Γ
ݸਓతࢿײ֮10-20%ఔɻͦͷఔ৽͠ ͍νϟϨϯδʹճ͢ • KubernetesͰྑ͍͠ɺTerraformͰྑ͍ɻͱΓ͋͑ͣͬͯΈΔͬͯͷ༗Γͩ͠ɺ ͩ͜ΘͬͯϕετϓϥΫςΟεΛݟ͚ͭʹߦ͘ͷ͋Γ • ͪΐͬͱͰྑ͍͔Βຊ൪ʹऔΓೖΕͯΈΔɻେࣄɻݕূͱຊ൪ͰֶΔྔ͕ഒҧ͏ • ʮ͍͔͠Β10-20%औΕͳ͍ʯݴ͍༁ɻ୭͕ѱ͍ͬͯ৫ͷऀ͕ѱ͍ɻ৫Λ ͤ͞Δؾ͋Δͷ͔ɻͦ͜ʹίϛοτ͢Δؾ͕͋ΔͷʹͰ͖ͳ͍ͳΒଵຫɻਓͷΞα
ΠϯؚΊͯମ੍ͮ͘ΓΛ͖͢ • ࣦഊͷҰͭʢԿ͕μϝͩͬͨͷ͔ཧղͰ͖Δʣ
͡Ό͋ɺԿ͔Β࢝ΊΔʁͦͷޙͷIaCͷτϨϯυ
2019ͷτϨϯυ • AWS CDK —> ॕGAʂʂ • Terraform —> v0.12
ϦϦʔεʂʂ • Terraformer ??
AWS CDK • ͨͿΜ୭͔͕հͯ͘͠ΕΔͱࢥ͏ͷͰɺҰൠతͳ͜ͱॻ͔ͳ͍ • No YAML, Yes Programing Language.
• গͳ͍ίʔυྔͰଟ͘ͷ͜ͱ͕࣮ݱͰ͖Δ • ͰɺCFnͳͷͰద༻࣌ͷڍಈͷཧղඞཁɻ࡞Δ͚ͩͷָ • ͨͿΜҰੈΛ෩ᴆ͢ΔΜ͡Όͳ͍͔ͳ • ࣾͰSDKͰྑ͍Μ͡ΌͶʁͱ͍͏͕ ʢಈ͖͔Δͱ͍͏ҙຯͰʣ
Terraform v0.12 • for, for_eachจ͕ॻ͚ΔΑ͏ʹͳͬͨ • NullΛׂΓͯՄೳʹʢʹఆٛͯ͠ͳ͍͜ͱͱಉ͡ʣ • Splitѻ͍͘͢ •
ͦͷଞ৭ʑ • ͑ɺɺ͜͜·ͰདྷͨΒϓϩάϥϛϯάݴޠͰॻ͘CDKͷํ͕…? • ͋·ΓτϦοΩʔͳػೳΛ͍͗͢Δͱ୭͍ͯ͜Εͳ͍ͷͰ ༻๏༻ྔҙ͠·͠ΐ͏
Terraformer
ݸਓతײ • ޙʹ ൚༻ݴޠ vs DSL ͕ຄൃ͢Δ • Ͱɺঃʑʹऩଋָͯ͠ʹͳΔͣͳͷͰWelcome •
CDKͩͱॻ͘͜ͱָʹͳΔ • ͚Ͳɺӡ༻ɾҡ࣋͢Δ͜ͱผɻCFnΛϥοϓ͍ͯ͠Δ͚ͩͳ ͷͰίʔυͷద༻࣌ͷڍಈมΘΒͣཧղ͕ඞཁ
ݸਓతײ • ʮ࡞ΔʯͬͯͷIaCͰ՝ղܾͯ͠ɺʮӡ༻ʯIaCͰղܾ͠ͳ ͍ͷ͋Γɻ • IaC͍ࣺͯɻ͋͘·ͰɺαʔϏεؒͷܨ͗ͱ͔Λදݱ͢Δ ͷɻߏஙखॱͱͯ͠දݱ͢Δͷɻͱ͔ɻ࣮ࡍͷύϥϝʔλ AWSίϯιʔϧݟͯͶͱ͔༗Γͩͱࢥ͏ɻ
Infrastructure as Code Tool ͍ࣺͯIaCͷ߹ͷ Pro/Con
αΫοͱͬͯϋϚΓͦ͏ͳ݅Λ·ͱΊΔ
·͞ʹ͍͍ͯΔɻ͙͢ʹͰͬͨํ͕͍͍ͭ • ඵͰө͞ΕΔ • ফͯ͠ɺ͙͢ʹద༻͢Εͳ͍ • Կճ࡞Δ • ྫ •
Datadog: Monitor • AWS: CloudTrail, SNS, SQS, Route53, etc… • ͜ͷล͔Β࢝ΊΔͱɺॻ͖ํ͍উख͕͔Δ
·͞ʹ͍͍ͯͳ͍ • ࡞ʹ͕͔͔࣌ؒΔͭʢDBܥʣ • Կճ࡞Βͳ͍ͭʢRedShiftCloudFrontʣ • ফ͢ͱϚζΠͭ • Α͘มߋ͢Δͭ •
͜ͷล͔Β࢝ΊΔͱɺ1ճ1ճͷ࡞ۀ͕ා͍ɻ͕ࠩग़ͨͱ͖ʹຖ ճٵऩ͢Δͷ͕ਏ͍ɻ͔͔࣌ؒΔͷͰςετ͔ͳΓ͠ΜͲ͍
·ͱΊ • ֓೦ʹπʔϧ͕͍͔ͭͳ͍͜ͱΑ͋͘Δɻਏ͍ɻROIߟ͑Δɻ • Ͱ֓೦ʢίϯηϓτʣπʔϧ͔ΒֶΔ͜ͱଟ͍ɻ • 10 - 20%ఔʢࣗ༝ʣͷٕज़ࢿߦֶ͍ͼଓ͚Δɻ •
ֶͦͯ͠Μͩ͜ͱΛࣄۀͷʹ׆͔͢ɻࣦഊؚΊͯɻ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠