-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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/List support for Consul_Keys #15356
Comments
You can store values to keys as json in consul (even using jsonencode in terraform). The variable structure: Details on jsonencoding, splitting, and joining, text into lists and maps. |
Thanks. However, not really a solution. In a complicated app, using templates to jury rig every value is worse than rough. data.consul_keys.var should have the same capabilities as -var on CLI. |
I am dealing with this right now. I am trying to store a TF variable map that is a list of AWS Tags. I can get the JSON into Consul but can't read it back out |
Hi everyone! Please note that this issue has moved over to hashicorp/terraform-provider-consul#15 as part of splitting the Consul provider out into its own repository. Let's keep discussing this request over there, so that the discussion doesn't get lost. |
Hi did you ever find a solution to this? |
No, I was never able to solve this.
…On Wed, Mar 6, 2019, 12:09 AM samtwilliams-emis ***@***.***> wrote:
I am dealing with this right now. I am trying to store a TF variable map
that is a list of AWS Tags. I can get the JSON into Consul but can't read
it back out
Hi did you ever find a solution to this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#15356 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADpTWyM3S8CGtZRYGK713D2Noto0Mmndks5vTpa3gaJpZM4OBVh7>
.
|
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. |
My project is a self-serve build/compile/deploy on immutable servers. In numerous places, I have a need for complex structures as variables, such as a structure to hold ip/port manifest for binding and security group creation. Maps/Lists (or nesting both) works fine as cli vars or tfvars, but Consul KV retrieved with data.consul_keys is all String. This is rough because I need Consul to carry my vars from other apps into TF.
Am I missing something? Is there some way to interpret KV as other than String?
If this needs to be a feature request, I believe there is a number of approaches. Interpreting Consul KV as other than string is one, such as storing HCL in Consul . It might be better to enhance the various interpolation functions to support accepting a single string input. For example, map function only works when supplied key/value, key/value, etc. However, the map function could accept a single string that includes a map structure. Same goes for List, etc. Or separate function that cast a string into map, list, etc assuming standard map/list/etc syntax. Or what about accepting HCL/JSON as input?
The text was updated successfully, but these errors were encountered: