-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 helper functions: keys(), values() #1915
Comments
That's actually an interesting idea. There isn't AFAIK a such built-in function yet. |
+1 this would be much more graceful than hardcoding those individual values in |
Yep I think this would be a great idea. A PR would be welcome, or one of us core folk will try to pick it up when we can. Worth noting that the functionality would be limited to direct variable access w/ defaults until we enhance the config language to fully support complex types. Still worth adding IMO. |
they work on maps with both keys and values that are string types, which AFAICT are the only types of maps we have right now. closes #1915
Doesn't seem like these functions are documented in the main Terraform docs yet? |
@edmundcraske See 8036528 It was documented about a month ago, docs website will be updated along with the next release. 😉 |
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. |
Is there an easy way to get only the keys or values defined in a map? For example, given:
It would allow you to easily just dump either the keys or values into other parts of the configuration.
This keeps one form having to maintain two variables that then must remain in sync with the correct number of items in each.
Thanks
The text was updated successfully, but these errors were encountered: