1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Terraform】よく使うTerraformコマンドまとめ

Posted at

はじめに

Terraformを勉強したくて、備忘録として、よく使われるTerraformのコマンドをまとめたいと思います。

よく使われるTerraformコマンド

1.Terraformのバージョン確認

$ terraform version

2.ワークディレクトへスイッチ

$ terraform -chdir=<path_to/tf> <subcommand>

3.ワーキングディレクトの初期化

$ terraform init

4.実行計画の参照

$ terraform plan

5.tfファイルの変更箇所を許可

$ terraform apply

6.インフラストラクチャの破壊

$ terraform destroy

7.実行計画のアウトプット

$ terraform plan -out <plan_name>

8.実行計画の破壊

$ terraform plan -destory

9.実行計画の適用

$ terraform apply <plan_name>

10.リソース名を指定して適用

$ terraform apply -target=<resource_name>

11.変数名を指定して適用

$ terraform apply -var my_variable=<variable>

12.プロバイダーの設定

$ terraform providers
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?