Closed yardbirdsax closed 1 year ago
Hi @yardbirdsax, Thank you for reporting this!
Which tfmigrate version do you use? I suspect a regression was introduced in tfmigrate v0.3.12 via #139. If you use the current latest v0.3.12, can you test in v0.3.11?
By the way, the -var-file argument has not been supported yet, but you can pass extra args to terraform plan command via environment variable TF_CLI_ARGS_plan="-var-file=somevars.tfvars"
. See #27.
@yardbirdsax I was able to reproduce the bug and fixed it in v0.3.13.
awesome feature, I was able to perform state surgery also.
TF_CLI_ARGS_plan="-var-file=somevars.tfvars"
Thank you for all your work on
tfmigrate
, it has saved our bacon many times when performing state file surgery! 🙇♂️We recently encountered a scenario where
tfmigrate
reported a successful plan with no changes, however after applying the migration we found that there were changes shown when we ranterraform plan
manually in the new state's home. We traced this down to the fact that there were non default/auto.tfvars
files that were required to be specified at plan time, and if these were not specified theplan
command as run bytfmigrate
returns an error. This is observed as well when debug logging is turned on.This doesn't seem like appropriate behavior, in that I would expect
tfmigrate
to throw an error if it cannot run theterraform plan
command successfully. Granted, I'm not sure how we'd specify those.tfvars
files be used, but that's more of a feature gap in my mind.