busser / tfautomv

Generate Terraform moved blocks automatically for painless refactoring
https://github.com/busser/tfautomv
Apache License 2.0
693 stars 24 forks source link

Support Terraform variables #22

Closed Fodoj closed 1 year ago

Fodoj commented 1 year ago

As of now, tfautomv does not allow to path Terraform variables and variable files. Are there plans to introduce this feature?

busser commented 1 year ago

Hi @Fodoj, thanks for opening this issue!

If I understand you correctly, we are talking about using the -var and -var-file flags for the terraform plan command that tfautomv runs. This is already possible by using the TF_CLI_ARGS_plan environment variable, which is a native Terraform feature. For example:

TF_CLI_ARGS_plan="-var-file=production.tfvars" tfautomv

You are likely not the only one who needs to do this, so I think we should explicitly document it. We are currently revamping our documentation for the v0.4 release, so I will add this to our backlog.

Is using this environment variable enough for your use case?

busser commented 1 year ago

PR #21 will document this configuration option.

Fodoj commented 1 year ago

I've actually tried it this way, but it did not work for me :) I will try again, perhaps something went wrong due to my local aliases. Thanks!