serverapps:configmgmt:terraform
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| serverapps:configmgmt:terraform [2018/10/30 02:49] – [参照元] hayashi | serverapps:configmgmt:terraform [2024/01/19 07:19] (現在) – hayashi | ||
|---|---|---|---|
| 行 2: | 行 2: | ||
| hashi corp製。\\ | hashi corp製。\\ | ||
| infraに特化 | infraに特化 | ||
| + | |||
| + | ===== install ===== | ||
| + | ==== Ubuntu ==== | ||
| + | < | ||
| + | wget -O- https:// | ||
| + | echo "deb [signed-by=/ | ||
| + | sudo apt update && sudo apt install terraform | ||
| + | </ | ||
| + | |||
| ===== 異なるtfstateファイルのリソースを参照する ===== | ===== 異なるtfstateファイルのリソースを参照する ===== | ||
| 行 14: | 行 23: | ||
| </ | </ | ||
| ==== リソース情報を参照 ==== | ==== リソース情報を参照 ==== | ||
| + | 参照用データソース作成 | ||
| < | < | ||
| data " | data " | ||
| 行 25: | 行 35: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | 参照する | ||
| + | |||
| + | < | ||
| + | resource " | ||
| + | instance_id | ||
| + | } | ||
| + | </ | ||
| + | ===== 特定のリソースのみを対象とする ===== | ||
| + | |||
| + | $ terraform {plan|apply|destroy} -target={resource name} | ||
| + | |||
| + | |||
| + | ===== 特定のアウトプットをコマンドで取得する ===== | ||
| + | |||
| + | $ terraform output outputvalue | ||
| + | |||
| + | ===== terraformで自動で読込まれるVariableファイル ===== | ||
| + | |||
| + | カレントディレクトリの terraform.tfvars ファイルと *.auto.tfvars というsuffixのファイルが自動的に読み込まれる。 | ||
serverapps/configmgmt/terraform.1540867795.txt.gz · 最終更新: by hayashi
