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のノリを理解する
Search
yuasa
November 01, 2021
1
250
Terraformのノリを理解する
Terraformのノリを解説する資料となっています。
yuasa
November 01, 2021
Tweet
Share
More Decks by yuasa
See All by yuasa
Prompt Hardener
melonattacker
0
590
LLM活用システムの脆弱性診断内製化の取り組み
melonattacker
0
250
OpenID Connect活用時のなりすまし攻撃対策の検討 - OpenID Summit Tokyo 2024
melonattacker
0
710
OSBT: OpenID Connect Scenario-Based Tester – CODE BLUE 2023
melonattacker
0
740
JWTセキュリティ入門
melonattacker
17
13k
OIDC Scenario Based Tester (OSBT)
melonattacker
0
380
Utility Token Price Simulator
melonattacker
0
370
Hyperledger Fabricさらっとガイド
melonattacker
0
540
Plasma, Plasma Cash, Plasma Chamber
melonattacker
0
450
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
BBQ
matthewcrist
89
9.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
4
200
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Transcript
Terraformのノリを理解する 2021/11/01 湯浅 1
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. ⾃⼰紹介 • 湯浅潤樹 •
名古屋⼤学B4 • Acompanyインターン⽣ • セキュリティサークルを運営 • 2時間前に親知らずを抜⻭し、喋りづらいです Twi$er: @junkitombob Twi$er: @nu_cybersec 2
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Terraformの概要 • 正式名称 :
強奪者 テラフォーム • 種類 : クリーチャー • ⽂明 : ⽔、⾃然 • 種族 : アウトレイジ • 「我こそが聖邪をあわせ持つ選ばれし...」 [1] h'ps://www.ka-nabell.com/sp/?act=sp_sell_detail&genre=7&id=100015813 3
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Terraformの概要 • IaC(Infrastructure as
Code)を実現するツール • インフラ構成をコードで管理できる • 管理画⾯でポチポチする必要がなくなる︕ • クラウドインフラ管理のHashiCorp社が提供 • AWS、Azure、GCPに対応 • .tf ファイルで構成を定義して、コマンドで簡単デプロイ 4 [2] h'ps://www.terraform.io/ [3] h'ps://www.lac.co.jp/lacwatch/service/20200903_002270.html
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Terraformのインストール • Linux •
MacOS 5 [4] Install Terraform
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Terraformのコード • クラウドのプロバイダーを指定 •
デプロイするリソースを指定 6
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Terraformの主なコマンド 主に使うコマンドは5つだけ︕ • terraform
init • ワークスペースの初期化 • プロバイダーのpluginをダウンロード • ダウンロードされたファイル群は .terraform ディレクトリ直下に配置 • terraform fmt • インフラ構成ファイルのフォーマットを整える 7 [5] h'ps://www.terraform.io/docs/cli/commands/init.html [6] h'ps://www.terraform.io/docs/cli/commands/fmt.html
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Terraformの主なコマンド • terraform validate
• インフラ構成コードの構⽂チェックをする • 記述が間違っている部分を⽰してくれる • terraform plan • 実⾏計画を⽰す • どのようなリソースが作成、修正、削除されるかを参照できる • terraform apply • plan で⽰された実⾏計画を実⾏する • 実際に構成がデプロイされる 8 [7] h'ps://www.terraform.io/docs/cli/commands/validate.html [8] h'ps://www.terraform.io/docs/cli/commands/plan.html [9] h'ps://www.terraform.io/docs/cli/commands/apply.html
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Azureの仮想マシンをデプロイしてみる 9 [11] Terraform
を使⽤して Azure で Linux VM とインフラストラクチャを構成する
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Azureの仮想マシンをデプロイしてみる 10 1. Azureにログイン
• az login コマンドで認証情報をワークスペースに提供できる 2. Terraform コードを実装する • Azureのプロバイダーを指定 • リソースグループの作成 • 仮想ネットワークとサブネットの作成 • セキュリティグループとルールの作成 • ネットワークインターフェースの作成 • SSHキーの作成 • 仮想マシンの作成
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Azureの仮想マシンをデプロイしてみる 3. Terraform を初期化する
4. Terraform 実⾏計画を作成する 11
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. Azureの仮想マシンをデプロイしてみる 5. Terraform 実⾏計画を適⽤する
12 Portal を確認するとデプロイされている SSHで仮想マシンにログインできる
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. CIへの組み込み • Github Actionsへの組み込みも簡単
• hashicorp/setup-terraform action を使⽤する 13 [12] h'ps://github.com/marketplace/acVons/hashicorp-setup-terraform
Strictly Confiden/al Copyright©株式会社Acompany All rights reserved. まとめ 強奪者 テラフォーム is
最強 14