I am unable to use -var-file flag with Terraform Cloud Workspace. It works as expected when I rename the var file to terraform.tfvars and run terraform plan without the -var-file flag.
Terraform throwing errors like:
Operation failed: failed validating Terraform variables: 1 error occurred:
Invalid HCL in variable “prefix”: At 1:10: Unknown token: 1:10 IDENT Hello-World
This use case is documented in multiple places in Terraform documentation:
Deploy development and production versions of an S3-hosted static website. Separate their configuration into files, directories, and workspaces, and explore the architectural trade-offs of each approach.
Appreciate the help!!
Jigar
Hi! Welcome to the forum!
What version of Terraform CLI are you using? Can you provide the [anonymized] cloud
settings block you have configured?
Hi @chrisarcand ,
The issue was resolved by upgrading Terraform CLI to 1.1.3. I believe it was a bug with Terraform 1.1.2 and previous.
Thanks,
Jigar
1 Like