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
270
Terraformのノリを理解する
Terraformのノリを解説する資料となっています。
yuasa
November 01, 2021
Tweet
Share
More Decks by yuasa
See All by yuasa
Prompt Hardener - Automatically Evaluating and Securing LLM System Prompts
melonattacker
1
32
プロンプトインジェクション2.0 : 進化する防御機構とその回避手法
melonattacker
5
3k
Prompt Hardener
melonattacker
0
650
LLM活用システムの脆弱性診断内製化の取り組み
melonattacker
0
300
OpenID Connect活用時のなりすまし攻撃対策の検討 - OpenID Summit Tokyo 2024
melonattacker
0
730
OSBT: OpenID Connect Scenario-Based Tester – CODE BLUE 2023
melonattacker
0
760
JWTセキュリティ入門
melonattacker
17
13k
OIDC Scenario Based Tester (OSBT)
melonattacker
0
390
Utility Token Price Simulator
melonattacker
0
370
Featured
See All Featured
Building Adaptive Systems
keathley
43
2.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
750
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Into the Great Unknown - MozCon
thekraken
40
2k
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