-
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
Variable of type map<string, list> #6700
Comments
Hi @joshuaspence! The new variable type support in 0.7 (master, for now) only supports strings, lists of strings, and maps from string to string. More complex nested structures are not supported yet. |
Hi @joshuaspence! As @apparentlymart points out, for now it is only possible to have maps which are string -> string (as before). Internally there is some support for this, but it is not currently exposed and that is not planned for 0.7. We will circle back to this post-0.7, but for now I'll close this as "by design". Thanks for bringing it up! |
Is there an issue that I can follow for supporting this type of variable? |
I would second the request for this functionality. |
I've ran into exactly the same issue (having conditional region-az map) today... |
Workaround for not having list support in map could be done like this:
And this compiles fine without any single error. However, in order to get that A-Z's list you'd need to do the following:
which basically doesn't work 😞 |
Part of the set of changes that would make this (map of lists) possible is currently going on in hashicorp/hil#42. That addresses making the interpolation language be able to represent the element types of maps and lists so that it can be understood that indexing a map of lists produces a list. There's still at least one follow up change required in Terraform to make variables accept such values, and likely more work at various layers in between to bring these things together. This comment is mainly just to create a link between these issues to remind me to pay attention to this one later when posting follow-ups. :D |
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. |
I've just built Terraform from the master branch in order to play with list variables. I've noticed that it is not possible to create a variable of type
map
which mapsstring
tolist
. For example, the following variable is invalid:The following error is reported:
Is this expected or a bug?
The text was updated successfully, but these errors were encountered: