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
Terraform Plan/Apply結果の自動通知
Search
Kohei Yamamoto
June 10, 2022
Programming
0
850
Terraform Plan/Apply結果の自動通知
Kohei Yamamoto
June 10, 2022
Tweet
Share
Other Decks in Programming
See All in Programming
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
110
品質ワークショップをやってみた
nealle
0
720
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
430
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
630
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
fossamagna
2
110
AkarengaLT vol.38
hashimoto_kei
1
130
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.3k
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
500
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
430
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
190
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
480
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
17k
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
6.6k
Code Review Best Practice
trishagee
72
19k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
The Cult of Friendly URLs
andyhume
79
6.6k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Designing Experiences People Love
moore
142
24k
Transcript
Terraform Plan/Apply結果の 自動通知 2022-06-08
自己紹介 山本 晃平 (Kohei Yamamoto) • Web接客プラットフォームを提供する株式会社Sprocketのバックエンドエンジニア • 言語: Go,
Scala, Python, Terraform • インフラ、ミドルウェア: Kubernetes, BigQuery, Dataflow, Apache Kafka • バックエンド技術を広く浅く学んでいます。 • 趣味: 合気道 • Twitter: @yamamocket
トピック • Terraformとは何か • Terraform Plan/Apply結果をどう通知しているか • 結果通知を導入にあたった経緯 • 通知の実現方法の詳細
Terraformとは何か • インフラリソースをコードで管理するIaCを実現するツール • Planコマンド: インフラの変更差分を表示 • Applyコマンド: インフラの変更差分を適用 •
CodeBuildを利用してTerraform Plan/ApplyをCI/CDに組み込んで いる
Terraform Plan結果の通知 • GitHubのコメントとしてPlan結果を投稿
Terraform Apply結果の通知 • Terraform Applyが成功したかどうかをSlackに通知
結果通知を導入に当たった経緯 結果通知がないとき
結果通知を導入に当たった経緯 結果通知がないとき つら い! つら い!
結果通知を導入に当たった経緯 結果通知があるとき
Plan通知の詳細 • tfnotifyというOSSツールを使用 • GitHubへのコメントだけでなく、Slackへの投稿なども可能 • 使い方 ◦ terraform plan
| tfnotify plan • 投稿のテンプレートは設定ファイルから指定可能
Apply通知の詳細 • EventBridgeとLambdaで実装 • CodeBuildの実行結果イベントにより、Lambdaを発火し、Slackの Webhook URLへポスト
まとめ・所感 • Terraform Plan/Applyをどのように通知しているかを紹介 • 特にPlanをGitHubコメントとして投稿することでTerraform開発体験 が飛躍的に良くなった。 ◦ 今までAWSコンソールへいちいちログインするのが煩わしかっ た。
• Applyの通知により、PRをマージした後GitHubへ再訪する必要がな くなった。