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

Map override in terraform.tfvars gives a syntax error. #647

Closed
2deviant opened this issue Dec 11, 2014 · 5 comments
Closed

Map override in terraform.tfvars gives a syntax error. #647

2deviant opened this issue Dec 11, 2014 · 5 comments

Comments

@2deviant
Copy link

Not sure if this is a bug report or a feature request, however.

variables.tf

variable "INSTANCE" {
    default = {
        TYPE = "t2.micro"
        SOMETHING = "override this"
    }
}

terraform.tfvars

INSTANCE.SOMETHING = "Something Else"

Command

>> terraform plan
invalid value "terraform.tfvars" for flag -var-file-default: Error parsing terraform.tfvars: Line 1, column 9: syntax error

I do believe I am using the correct override syntax as described here: http://www.terraform.io/intro/getting-started/variables.html.

@mitchellh
Copy link
Contributor

You can work around this by quoting the key: "INSTANCE.SOMETHING" = "Something else".

I'm not sure if it makes sense to support this syntax without quoting in HCL first class... I want to think about it further. Thoughts, @armon?

@armon
Copy link
Member

armon commented Dec 17, 2014

Hmm, I think it does look better without the quoting, but also not sure about the complexity in HCL. I don't think it would be that much worse?

@mitchellh
Copy link
Contributor

Nope, wouldn't be hard at all (just a lexer change). I was just wondering if it maybe conflicted with anything obviously. I'll make the change.

@mitchellh
Copy link
Contributor

Fixed

@ghost
Copy link

ghost commented May 4, 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 May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants