-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Not accepting maps from a var file! #8057
Comments
Though this is just a workaround, I was able to avoid this kind of error when set e.g. variable "somemap" {
type = "map"
default = {}
} I comfirmed it in ver 0.7.0 and 0.7.1 |
Just hit the same issue with Terraform 0.7.2 trying to pass an empty map from the command-line. The Terraform template: variable "foo" {
type = "map"
} Trying to set the variable from the command-line:
This caused the error:
@lamanotrama's workaround helped: variable "foo" {
type = "map"
default = {}
} |
Hi - just wondering if there's plans to work on this - if not - I'd be happy (and would suggest) a docs update - because this is very counter-intuitive. :) |
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. |
Terraform Version: v0.7.0
Affected Resource: Terraform Core
terraform.tvfars
main.tf
This should simply output the map. But instead, I get this error:
variable somemap should be type map, got list
It works as expected if I run
TF_VAR_somemap='{foo = "bar", baz = "qux"}' terraform apply
. Another interesting tidbit--if I change the var type tovariable "somemap" { type = "list" }
, I get the error:variable somemap should be type list, got list
.According to the docs here, this should work.
The text was updated successfully, but these errors were encountered: