Terraform -var-file not working for file present in the same directory

1.2k views Asked by At

I am trying to pass file name as command Line argument and following the examples i found on internet. following is the command i am using :

terraform plan -var-file=cert.tf

and get the following error:

invalid value "cert" for flag -var-file: Error reading cert: open cert: The system cannot find the file specified

Cert.tf is present in the same path where i am executing the command. Has anyone else experienced this ?

1

There are 1 answers

1
mcheshier On

Your variables file needs to have the .tfvars extension.