Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SREに優しいTerraform構成 modulesとstateの組み方 / terrafor...
Search
コドモン開発チーム
June 04, 2026
390
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SREに優しいTerraform構成 modulesとstateの組み方 / terraform-modules-state-for-sre
コドモン開発チーム
June 04, 2026
More Decks by コドモン開発チーム
See All by コドモン開発チーム
コドモンに入社してAI活用により、 設計がより重要だと感じた背景
codmoninc
0
33
実装・設計だけでなく、運用・保守にもAIを広げてみた / We Took AI Beyond Coding and Into Operations and Maintenance
codmoninc
0
23
AIが無かった頃の素敵な出会いの話
codmoninc
1
380
5分で問診!Composer セキュリティ健康診断
codmoninc
0
850
アラート疲れからの脱却 - リソースタグで仕分けるSlack通知戦略 / Breaking Free from Alert Fatigue – A Slack Notification Strategy Using Resource Tags for Routing
codmoninc
0
43
モノリスなプロダクトの「ほどよい」リプレイス戦略 / A "Just Right" Replacement Strategy for Monolithic Products
codmoninc
0
280
Don't Just Patch — MOTTAINAI! Learn Security from Laravel CVE Diffs
codmoninc
0
270
ソースコードで比較する React / Vue / Svelte の セキュリティ設計思想 / security design philosophy react vue svelte
codmoninc
5
660
少人数SREチームが、長寿なシステムを構築・運用するための取り組み / Efforts by a Small SRE Team to Build and Operate Long-Lived Systems
codmoninc
0
380
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
400
The Pragmatic Product Professional
lauravandoore
37
7.4k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
790
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
460
Amusing Abliteration
ianozsvald
1
240
Done Done
chrislema
186
16k
Chasing Engaging Ingredients in Design
codingconduct
0
260
エンジニアに許された特別な時間の終わり
watany
108
250k
Site-Speed That Sticks
csswizardry
13
1.4k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
400
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
160
Transcript
SRE に優しい Terraform 構成 ~ modules と state の組み方~
2 経歴など CIerのAWSエンジニアを経て、2026年1月にコドモンにSREとして 入社。AWS Community Builder(24-25)、HashiCorp Ambassador(25-26)。都内でクラウド系コミュニティ「クラウド 食堂」を運営中。 都内在住、出身は栃木県宇都宮市。バンドとかライブがすき🎸 自己紹介
檜山 準 ひやま じゅん @hiyanger
3 Mission
4 すべての先生に 子どもと向き合う 時間と心のゆとりを こんなプロダクトを開発しています メインプロダクトは、保育・教育施設向けWebアプリケーション。 保護者と施設のやり取りを支えるモバイルアプリケーションや、施設職員向けモバイル版 アプリケーション、外部サービスと連携するAPIなども開発しています。
5 2026/4 25,382 施設
6 📝 はじめに 🤔 state と modules の問題点 👦 コドモンの
Terraform 構成 📝 まとめ もくじ
7 はじめに
8 🗡 state 分割は 積極的に! 🛡 modules 利用は 慎重に!
9 state が少ない場合と modules を使った場合におきる問題
10 CONFIDENTIAL - © 2022 CoDMON Inc. 10 state が少ない場合における問題
・1リソースでもエラーがあるとすべてのリソースが操作できない ・ plan / applyに時間がかかる (100リソースで 1分前後が超おおまかな目安) 🗡 state 分割は 積極的に!
11 CONFIDENTIAL - © 2022 CoDMON Inc. 11 modules を使った場合におきる問題
・module を修正すると、対象の全環境に波及する (環境ごとに変えたい場合、分岐が必要になり、変更がより手間になる) ・直感的にリソースが把握できず、呼び出し先を追う必要がある 🛡 modules 利用は 慎重に!
12 コドモンにおける Terraform 構成
13 CONFIDENTIAL - © 2022 CoDMON Inc. 13 コドモンにおける Terraform
構成 aws ├── prd │ ├── サービス A │ │ ├── main.tf (backend) │ │ ├── ecs.tf │ │ ├── iam.tf │ │ └── ... │ ├── サービス B │ │ └── ... │ └── ... ├── dev │ └── ... └── ... 💡 state はサービス(ライフサイクル)単位で 分割されている 💡 環境ごとに機能が作られている (module 利用が少ない) 💡※ remote state もない (data source 利用で参照なし) ↓ ⚡他の機能への依存が最小化されている! 👶 新メンバーでも扱いやすい!( SREに優しい)
14 CONFIDENTIAL - © 2022 CoDMON Inc. 14 コドモンにおける Terraform
構成の歴史 2020/8 2024/2 2024/4 👷Terraform 構成整備 開始 state数:21 module数:41 👷Terraform 構成整備 完了 state数:436 module数:27 総移行リソース数 6,462 🤖Terraform 運用開始
15 まとめ
16 🗡 state 分割は 積極的に! 🛡 modules 利用は 慎重に! Repeat
!
17 ご清聴ありがとうございました