When the use of plan files is disabled (USE_PLANFILE=0) the terraformsh apply doesn't include the variable files picked up from the configuration tree (default or otherwise).
Configuration
In our specific situation we're trying to mimic stock Terraform behaviour.
For this reason our .terraformshrc in the config tree looks like this:
.terraformrc:
When running terraformsh apply in the config tree I get:
❯ terraformsh apply
<path_to_>/terraformsh: Info: Found terraform command 'apply'
+ cd "<module_path>"
+ terraform apply -input=false
Note the missing -var-file entry?
Notes
Looking at the difference between the implementation of terraform plan vs terraform apply I can see that "${VARFILE_ARG[@]}" is missing from terraform apply.
Adding this to my local copy works but I suspect that you only want this when USE_PLANFILE=0 so it should probably be conditional.
The same issue exists for destroy and likely other commands (when appropriate to supply tfvars)
Hi,
Firstly - great tool - thank you very much.
Problem Description
When the use of plan files is disabled (
USE_PLANFILE=0
) theterraformsh apply
doesn't include the variable files picked up from the configuration tree (default or otherwise).Configuration
In our specific situation we're trying to mimic stock Terraform behaviour. For this reason our
.terraformshrc
in the config tree looks like this:.terraformrc
:Expected behaviour
When running
terraformsh apply
(orterraformsh destroy
) in the config tree I expect:Observed behaviour
When running
terraformsh apply
in the config tree I get:Note the missing
-var-file
entry?Notes
Looking at the difference between the implementation of terraform plan vs terraform apply I can see that
"${VARFILE_ARG[@]}"
is missing fromterraform apply
. Adding this to my local copy works but I suspect that you only want this whenUSE_PLANFILE=0
so it should probably be conditional.The same issue exists for destroy and likely other commands (when appropriate to supply tfvars)