In the workspace example it mirrors (symlinks) a tfvars file into the current directory so it will get loaded automatically (and the other files in the params dir won't get loaded).
This symlink could be avoided by parsing the file and exporting TF_VAR_* environment variables for each value found in the file.
This would be a work around for Terraform not being able to load tfvars per workspace and perhaps other use cases I haven't thought of. Maybe people just prefer their params to be sitting together in a separate directory, I don't know.
In the workspace example it mirrors (symlinks) a tfvars file into the current directory so it will get loaded automatically (and the other files in the params dir won't get loaded).
https://github.com/raymondbutcher/pretf/blob/77ef2f69681556a8a05dc584b8582994fc6e8c63/examples/workspaces/pretf.workflow.py#L25-L27
This symlink could be avoided by parsing the file and exporting
TF_VAR_*
environment variables for each value found in the file.This would be a work around for Terraform not being able to load tfvars per workspace and perhaps other use cases I haven't thought of. Maybe people just prefer their params to be sitting together in a separate directory, I don't know.
Usage might be like this: