Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Terraform Provider for Azure に貢献してみた話
Search
Tatsuro Shibamura
PRO
February 18, 2020
Technology
670
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Terraform Provider for Azure に貢献してみた話
Tatsuro Shibamura
PRO
February 18, 2020
More Decks by Tatsuro Shibamura
See All by Tatsuro Shibamura
AI Agent を本番環境へ―― Microsoft Foundry × Azure Serverless で作る Enterprise-Ready な基盤
shibayan
PRO
2
1.4k
Azure Cosmos DB パフォーマンス最適化入門 - 設計・開発・運用の実践テクニック
shibayan
PRO
0
600
Azure Serverless のパフォーマンスとコストを 最適化
shibayan
PRO
0
20
Microsoft Azure で実現する最新クラウドアーキテクチャ
shibayan
PRO
0
27
Hack Azure! #5 - Geek of Azure Serverless
shibayan
PRO
0
140
.NET Conf 2020 Online - .NET 5 リリース記念パーティートーク
shibayan
PRO
0
10k
Azure Functions と SendGrid の良い関係
shibayan
PRO
0
1.4k
Azure Serverless を活用したリアルタイム Web のすべて
shibayan
PRO
1
3.1k
祝 東日本リージョン一般提供! Azure Application Insights 基礎と実践
shibayan
PRO
1
42k
Other Decks in Technology
See All in Technology
CLIライブラリ開発を支える技術
htnabe
0
130
Genieを崇めよ
kameitomohiro
0
160
AI に書かせたその API、 “信頼” できますか?
nagix
0
120
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
300
人間はどの意思決定を手放せるのか
kawasima
15
7.3k
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
2026_devsumi_ozono.pdf
o3
3
520
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
150
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
2.1k
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
5
640
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
240
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The Spectacular Lies of Maps
axbom
PRO
1
1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
A designer walks into a library…
pauljervisheath
211
25k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
WCS-LA-2024
lcolladotor
0
830
Navigating Weather and Climate Data
rabernat
0
520
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Optimising Largest Contentful Paint
csswizardry
37
4k
Claude Code のすすめ
schroneko
67
230k
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 の人が丁寧にレビューしてくれました • 負荷を下げるためにスタイルなどはしっかり守る