1

Terraform v0.11.12 returns "Usage" when I try ./terraform plan, apply, or validate. I have main.tf, variables.tf, and terraform.tfvars files located in the same directory from where I am running ./terraform. I've provided links to each file down below.

./terraform plan
Usage: terraform plan [options] [DIR-OR-PLAN]

  Generates an execution plan for Terraform.

  This execution plan can be reviewed prior to running apply to get a
  sense for what Terraform will do. Optionally, the plan can be saved to
  a Terraform plan file, and apply can take this plan file to execute
  this plan exactly.

  If a saved plan is passed as an argument, this command will output
  the saved plan contents. It will not modify the given plan.
./terraform version

Terraform v0.11.12

+ provider.external v1.1.1
+ provider.ignition v1.1.0
+ provider.null v2.1.1
+ provider.template v2.1.1
+ provider.vsphere v1.11.0

https://github.com/openshift/installer/blob/master/upi/vsphere/main.tf

https://github.com/openshift/installer/blob/master/upi/vsphere/variables.tf

https://github.com/openshift/installer/blob/master/upi/vsphere/terraform.tfvars.example

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
mca
  • 11
  • 1
  • 3

1 Answers1

1

You can't be in the correct directory.

You're specifying

./terraform plan

which means the terraform binary should be in the same directory as your terraform resource files, which according to your source control on Github, it is not.

Set up the terraform binary correctly so that it is in your $PATH and try again.

If you were in the correct directory, the first thing terraform should tell you is that you need to run

terraform init
Garreth McDaid
  • 3,449
  • 1
  • 27
  • 42