Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.0: "terraform plan" complains about usage error that is not obvious to me :-) #243

Closed
larryg-sg opened this issue Aug 28, 2014 · 8 comments
Labels

Comments

@larryg-sg
Copy link

I've been playing with Terraform 0.1.1, and I got a minimal setup going that let me run terraform plan without any extra options. But with 0.2.0, terraform plan gives me the usage help message, as if it is expecting something extra on the command line—but I can't figure out what. I've tried adding -var and -var-file options, but nothing changes.

I have a directory with the following.

aws.tf:

variable "aws_access_key" {}
variable "aws_secret_key" {}

provider "aws" {
  access_key = "${var.aws_access_key}"
  secret_key = "${var.aws_secret_key}"
  region = "us-west-2"
}

qa-elb.tf:

resource "aws_elb" "qa-dispatch" {
  name = "qa-dispatch"
  availability_zones = ["us-west-2b"]

  instances = []

  health_check {
    healthy_threshold = 6
    unhealthy_threshold = 2
    target = "HTTPS:443/ping"
    interval = 30
    timeout = 5
  }

  listener {
    instance_protocol = "HTTPS"
    instance_port = 443
    lb_protocol = "HTTPS"
    lb_port = 443
  }
}

terraform.tfvars:

aws_access_key=<redacted>
aws_secret_key=<redacted>
@mitchellh
Copy link
Contributor

Strange, I'm going to give this a shot now.

@mitchellh
Copy link
Contributor

Reproduced. Odd. Looking.

@mitchellh
Copy link
Contributor

Found the bug, you can workaround it by putting spaces between = in your tfvars file.

@mitchellh
Copy link
Contributor

But we're going to fix this now.

@mitchellh mitchellh added the bug label Aug 28, 2014
@mitchellh
Copy link
Contributor

Fixed here: hashicorp/hcl@71e25b3

@larryg-sg
Copy link
Author

One other thing I should note: The values I used in my .tfvars file were unquoted. So in addition to putting space around the equals operator, I had to enclose the values in double quotes. This was a successful workaround.

Thanks!

@rahulbhatu
Copy link

@larryg-sg Thanks you so much for bringing this up here. i have been troubleshooting this for a couple of days now. Finally, terraform plan runs.

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants