LoginSignup
0
0

More than 3 years have passed since last update.

[terragrunt] xxx-all系で個別処理にパイプやリダイレクト等の処理を追加する方法

Posted at

xxx-all系で個別処理に処理を追加する方法

extra_argumentshooksではできない処理が可能な方法です。

下記のような、xxx-all系で

$ terragrunt plan-all
$ terragrunt apply-all

下記のように、個別のコマンドにパイプを用いたいとき(パイプでなくても同様)は、

$ terragrunt plan | tee ./terraform.log

terraformのwrapperを準備し、

tfwrapper.sh
#!/bin/bash

terraform $@ 2>&1 | tee ./terraform.log

terragrunt-tfpathオプションに上記のようなファイルパスを渡すことでできます。

$ terragrunt plan-all --terragrunt-tfpath ./tfwrapper.sh

参考

0
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
0
0