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 Provider for Azure に貢献してみた話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tatsuro Shibamura
February 18, 2020
Technology
650
0
Share
Terraform Provider for Azure に貢献してみた話
Tatsuro Shibamura
February 18, 2020
More Decks by Tatsuro Shibamura
See All by Tatsuro Shibamura
# Azure Cosmos DB パフォーマンス最適化入門 - 設計・開発・運用の実践テクニック
shibayan
0
540
Hack Azure! #5 - Geek of Azure Serverless
shibayan
0
130
.NET Conf 2020 Online - .NET 5 リリース記念パーティートーク
shibayan
0
9.8k
Azure Functions と SendGrid の良い関係
shibayan
0
1.3k
Azure Serverless を活用したリアルタイム Web のすべて
shibayan
1
3k
祝 東日本リージョン一般提供! Azure Application Insights 基礎と実践
shibayan
1
42k
なかなか楽にならないSSL/TLS証明書の話
shibayan
2
1.9k
.NET Conf 2018 Tokyo
shibayan
1
4.1k
最近の Azure App Service について
shibayan
0
1.4k
Other Decks in Technology
See All in Technology
Ruby::Boxでできること、Refinementsでできること
joker1007
3
380
形式手法特論:公平性制約の位相的特徴づけ #kernelvm / Kernel VM Study Kansai 12th
ytaka23
1
710
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
180
AI駆動開発が変える、大規模開発の前提 ーHuman in the Loop から Human on the Loop へ / AIE2026
visional_engineering_and_design
3
2.5k
Strands Agents超入門
kintotechdev
1
160
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
340
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
230
Sony_KMP_Journey_KotlinConf2026
sony
2
210
GoとSIMDとWasmの今。
askua
3
490
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
720
OCI Oracle AI Database Services新機能アップデート(2026/03-2026/05)
oracle4engineer
PRO
0
180
Claude Codeを組織で使いこなす— サーバサイドAIエージェント運用の実践知
techtekt
PRO
0
190
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
Google's AI Overviews - The New Search
badams
0
1k
Between Models and Reality
mayunak
4
320
It's Worth the Effort
3n
188
29k
The browser strikes back
jonoalderson
0
1.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
How GitHub (no longer) Works
holman
316
150k
The Language of Interfaces
destraynor
162
27k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
550
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Transcript
Terraform Provider for Azure に貢献してみた話 @shibayan
はじめに • AzureRM Terraform Provider に使いたい機能が入ってなかっ たので自分で追加した話です • Go をちゃんと触ったのがこれが最初でした
• 公式の README をちゃんと読めば迷わないです • https://github.com/terraform-providers/terraform-provider- azurerm/blob/master/README.md
今回の経緯 • 何故か Azure Function には ip_restriction 設定がなかった • App
Service 側にはあるので謎 • Issue が上がってて要望も多そうだった(自分もその一人) • 凄く使いたいのに、数か月動きがなかった • ないんだったら自分で実装すれば(以下略 • https://github.com/terraform-providers/terraform-provider- azurerm/pull/5440
必要なもの • Go version 1.13.x • Make for Windows •
ビルドするために必要 • Git Bash for Windows • Git for Windows に付いてきたものを利用した • Visual Studio Code + Go Extension
貢献までの流れ • Issue を検索して、同じ問題が上がっていないか調べる • 無い場合は先に Issue を作ってから • コードを修正、テストを追加
• make build を実行して Provider をビルド、手元で確認 • make test / make testacc でテストが通ることを確認 • testacc は acceptance tests のこと
Visual Studio Code は必須ツール 保存時にインデントを 自動で整えてくれる コンテキストに沿って IntelliSense が動作
ビルドした Provider を確認する • ビルドした terraform-provider-azurerm.exe を “.terraform¥plugins¥windows_amd64” 以下にコピー •
terraform init を再度実行 • これまで通り terraform plan や apply を実行 • ちゃんと PR にはテストコードを追加しましょう
PR を作成すると自動でラベルが付く
Windows 環境での注意点 • Git 設定が autocrlf = true だと make
build で落ちる • Formatter / Linter が crlf だとエラー扱いに • autocrlf = false にしてから clone しなおす • make の実行は Git Bash から行う • シェルスクリプトが使われてるので cmd / pwsh では無理 • WSL を使って構築した方が無難
貢献してみた感想 • Visual Studio Code があれば何とかなる • Formatter / Linter
の設定を読み取っていい感じに保存してくれる • ビルドツール周りが Windows だと少し辛い • Make for Windows や Git Bash for Windows が必要 • Terraform Provider の構造は簡単 • リソースへの CRUD を行うコードを定義している • Azure Resource Manager の知識が重要
おわりに • まだまだ機能が抜け落ちてる部分が多いので貢献しましょう • Issue を立ててリアクションを集めるのも貢献 • CI がガチガチに組まれている安心感 •
コーディングスタイルが統一されて便利でした • HashiCorp の人が丁寧にレビューしてくれました • 負荷を下げるためにスタイルなどはしっかり守る