get_terraform_commands_that_need_vars
unitstack
Usage
get_terraform_commands_that_need_vars() --> list(string)get_terraform_commands_that_need_vars returns apply, console, destroy, import, plan, push, and refresh. Use it as the commands of an extra_arguments block that passes -var or -var-file:
terraform { extra_arguments "common_vars" { commands = get_terraform_commands_that_need_vars() arguments = ["-var-file=${get_terragrunt_dir()}/../common.tfvars"] }}Examples
locals { commands = get_terraform_commands_that_need_vars() # ["apply", "console", "destroy", "import", "plan", "push", "refresh"]}