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
あけおめLINE 傾向とその対策
nasa9084
0
340
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
3
820
AIエージェントを安全で速い現場監督にする:Jev・Obsidian・メタハーネス
x5gtrn
PRO
0
130
Goodbye ShellScript, Hello File-based App
shunsock
0
1.2k
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
1
600
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
550
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
2
430
品質と信頼性を地続きにする
grimoh
3
1.2k
Harness Engineering on Rails
joelq
0
610
AI Native Platform Engineering 〜PlatformとAgileで“作る速さ”を“価値”へ〜
uya116
0
210
Datadog で始める トークンセーフティなAI 導⼊と定着
vkbaba
1
110
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
180
Featured
See All Featured
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
330
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Documentation Writing (for coders)
carmenintech
77
5.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Designing for Performance
lara
611
70k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
740
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
260
Building Applications with DynamoDB
mza
96
7.2k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
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 の人が丁寧にレビューしてくれました • 負荷を下げるためにスタイルなどはしっかり守る