{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/9984","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/9984/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/9984/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/9984/events","html_url":"https://github.com/hashicorp/terraform/issues/9984","id":188166635,"number":9984,"title":"Issues parsing tfvars for a map variable","user":{"login":"rhoml","id":369350,"avatar_url":"https://avatars.githubusercontent.com/u/369350?v=3","gravatar_id":"","url":"https://api.github.com/users/rhoml","html_url":"https://github.com/rhoml","followers_url":"https://api.github.com/users/rhoml/followers","following_url":"https://api.github.com/users/rhoml/following{/other_user}","gists_url":"https://api.github.com/users/rhoml/gists{/gist_id}","starred_url":"https://api.github.com/users/rhoml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhoml/subscriptions","organizations_url":"https://api.github.com/users/rhoml/orgs","repos_url":"https://api.github.com/users/rhoml/repos","events_url":"https://api.github.com/users/rhoml/events{/privacy}","received_events_url":"https://api.github.com/users/rhoml/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":127939292,"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-09T04:49:03Z","updated_at":"2016-11-11T06:25:57Z","closed_at":"2016-11-11T06:25:57Z","body":"\r\n\r\n### Terraform Version\r\nterraform 0.7.8\r\n\r\n### Affected Resource(s)\r\ntfvars variables\r\n\r\n### Terraform Configuration Files\r\n\r\nI am trying to create a netwok and subnet for a tenant in openstack and while doing that I created a map variable for the cidr attribute. The idea was to load this variable from a tfvars file so using the following config terraform actually says that there is an error\r\n\r\n```hcl\r\nmyvar = '{ key = \"x.x.x.x\" }'\r\n```\r\n\r\n`invalid value \"terraform.tfvars\" for flag -var-file: Error parsing terraform.tfvars: At 1:25: illegal char`\r\n\r\nterraform validate doesn't complain at all about this tfvars but it complains at terraform plan\r\n\r\n### Expected Behavior\r\nAccording to https://www.terraform.io/intro/getting-started/variables.html on __Assigning Maps__ we should be able to use this within the tfvars\r\n\r\n`$ terraform plan -var 'amis={ us-east-1 = \"foo\", us-west-2 = \"bar\" }'`\r\n\r\nMaybe I am wrong asumming that this can be set up on the tfvars? I moved this configs into the variables.tf and it works properly\r\n\r\nThere is another case where the tfvars syntax is the following\r\n\r\n```hcl\r\nmyvar = {key = \"x.x.x.x\"}\r\n```\r\nIn this case terraform validate doesn't complain and terraform plan either but when terraform plan it complains \r\n`invalid value \"terraform.tfvars\" for flag -var-file: Error parsing terraform.tfvars: At 1:34: illegal char`"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/259890412","html_url":"https://github.com/hashicorp/terraform/issues/9984#issuecomment-259890412","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/9984","id":259890412,"user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T06:25:57Z","updated_at":"2016-11-11T06:25:57Z","body":"With `myvar = {key = \"x.x.x.x\"}` everything works for me.\r\n\r\nYour first example doesn't work because HCL doesn't allow single quote strings, and what you actually want is the native map anyways (what you did later on, and what worked for me above). \r\n\r\nYou almost had it! The syntax you do on the command line is the same but I think you assumed the value would be a string when in fact you can just copy and paste it directly and it would work!"}}
{"actor":{"display_login":"mitchellh"}}