The most common ways of managing the variable values in a Terraform Cloud/Enterprise workspace are by either configuring them in the workspace variables section or providing a Terraform variable definition file named
*.auto.tfvars file together with the Terraform configuration. Using the latter method will result in applying the variable values from the file in all workspaces that use this Terraform configuration.
In some use cases, users may want to have several Terraform variable definition files together with the Terraform configuration and have the Terraform Cloud/Enterprise workspaces each use a different variable definition file.
Have a Terraform variable definition file(s) that are not named like
*.auto.tfvarstogether with the Terraform configuration uploaded to the Terraform Cloud/Enterprise workspace(s) e.g. have the file(s) committed to the VCS repository connected to the workspace(s).
Go to the Terraform Cloud/Enterprise workspace Variables section.
Add a new environment variable named
myfile.tfvarswith the path of the variable definition file relative to the working directory configured for the Terraform Cloud/Enterprise workspace.
Specifying command-line arguments for the Terraform CLI via environment variables.