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
0
620
Terraform Provider for Azure に貢献してみた話
Tatsuro Shibamura
February 18, 2020
Tweet
Share
More Decks by Tatsuro Shibamura
See All by Tatsuro Shibamura
# Azure Cosmos DB パフォーマンス最適化入門 - 設計・開発・運用の実践テクニック
shibayan
0
470
Hack Azure! #5 - Geek of Azure Serverless
shibayan
0
110
.NET Conf 2020 Online - .NET 5 リリース記念パーティートーク
shibayan
0
9.6k
Azure Functions と SendGrid の良い関係
shibayan
0
1.2k
Azure Serverless を活用したリアルタイム Web のすべて
shibayan
1
2.9k
祝 東日本リージョン一般提供! Azure Application Insights 基礎と実践
shibayan
1
42k
なかなか楽にならないSSL/TLS証明書の話
shibayan
2
1.8k
.NET Conf 2018 Tokyo
shibayan
1
4k
最近の Azure App Service について
shibayan
0
1.3k
Other Decks in Technology
See All in Technology
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.6k
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
1
240
Claude Code for NOT Programming
kawaguti
PRO
1
130
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
220
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
160
Red Hat OpenStack Services on OpenShift
tamemiya
0
200
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
410
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
790
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
330
旅先で iPad + Neovim で iOS 開発・執筆した話
zozotech
PRO
0
230
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
3
250
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
130
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
The Limits of Empathy - UXLibs8
cassininazir
1
220
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
54
The SEO Collaboration Effect
kristinabergwall1
0
360
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
200
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
440
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.4k
Being A Developer After 40
akosma
91
590k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
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 の人が丁寧にレビューしてくれました • 負荷を下げるためにスタイルなどはしっかり守る