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 Introduction
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Akira Yumiyama
April 07, 2018
Technology
0
140
Terraform Introduction
Akira Yumiyama
April 07, 2018
Tweet
Share
More Decks by Akira Yumiyama
See All by Akira Yumiyama
GAE/Python2 to Python3 Migration Journey
akiray03
0
1.8k
オブジェクト指向で考える アプリケーションアーキテクチャ設計 / Object-Oriented Conference 2020
akiray03
6
24k
Case Study of Machine Learning in CrowdWorks
akiray03
0
2.1k
CrowdWorksを支える管理画面 - 管理画面チラ見せ♡ナイト #5
akiray03
0
1.7k
DevSumi2015 19-D-2 IIJ社内におけるアジャイル開発、DevOpsへの取り組み
akiray03
0
470
mruby introduction -- jinbocho.rb #01
akiray03
9
1.2k
Other Decks in Technology
See All in Technology
LLM活用の壁を超える:リクルートR&Dの戦略と打ち手
recruitengineers
PRO
1
200
Devinを導入したら予想外の人たちに好評だった
tomuro
0
780
Webアクセシビリティ技術と実装の実際
tomokusaba
0
190
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4k
チームメンバー迷わないIaC設計
hayama17
5
3.5k
Microsoft Fabric のワークスペースと容量の設計原則
ryomaru0825
2
230
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
22k
パネルディスカッション資料 (at Tableau Now! - 2026-02-26)
yoshitakaarakawa
0
1k
Databricks (と気合い)で頑張るAI Agent 運用
kameitomohiro
0
350
自動テストが巻き起こした開発プロセス・チームの変化 / Impact of Automated Testing on Development Cycles and Team Dynamics
codmoninc
0
810
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
360
2026-02-25 Tokyo dbt meetup プロダクトと融合したCI/CD で実現する、堅牢なデータパイプラインの作り方
y_ken
0
160
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The SEO identity crisis: Don't let AI make you average
varn
0
400
WENDY [Excerpt]
tessaabrams
9
36k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
140
Skip the Path - Find Your Career Trail
mkilby
1
71
Bash Introduction
62gerente
615
210k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
210
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
Terraform超入門 2018/4 @akiray03
Terraformとは何か https://www.terraform.io/ HashiCorpの作るインフラ構成管理ツール
Terrafromは何であって何でないのか • Terraformはインフラリソースをコード管理するツールです • Chefやansibleとは少しレイヤが違います AWS or GCP or Azure
or ... Compute Instance Compute Instance nginx ruby … nginx ruby … Chef or ansible or ..
Terraformは何をしているのか • Terraformはユーザが記述した設定ファイルに従って、APIを呼び出しているだけで す • AWSやGCPのAPI呼び出しのラッパーツール、という見方もできます • Terraformの魅力はどこにあるのでしょうか 設定ファイル (
.tf ) AWS API GCP API
Terraformの魅力(1) インフラの状態を保持する • Terraformは tfstate というJSONファイルにTerraformが操作したリソースの状態を 保存しています • tfstateに記録された状態と、現在のAWSやGCP上のリソースの状態を比較するこ とで、期待した状態との差分を計算し、期待した状態に収束するような操作(追加・
削除・変更)を実現してくれます 設定ファイル ( .tf ) AWS API GCP API tfstate
Terraformの魅力(2) 依存関係を解決してくれる • AWSやGCPでCompute Instance を起動するためには、依存するリソースが存在 している必要があります (例: ネットワークや、セキュリティ設定、等) •
起動したインスタンスのPublic IPに対してDNSレコードを設定する、という状況でも 依存関係が発生します • Terraformはこのようなリソース間の依存関係を解決し、適切な順番でAPI呼び出し を行ってくれます
Terraformの魅力(2) 依存関係を解決してくれる resource "aws_instance" "web" { ami_id = "ami-123456" instance_type
= "t2.micro" } resource "aws_route53_record" "www" { zone_id = "Z12345678" name = "abc.example.com" type = "A" ttl = "300" records = ["${aws_instance.web.public_ip}"] }
tfstateの管理 • Terraformの認識しているリソース状態はtfstateというJSONファイルに保存される • このファイルは、ローカルに配置することも、Amazon S3やGoogle Cloud Storage に保存することもできる ◦
S3やGCSに保存することで、複数人・複数端末での tfstateの共有がやりやすくなる ◦ が、同時に操作すると混乱状態になるので注意 • tfstate の単位で plan / apply することになるので、適切なサイズに分割することが 重要