You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The values of the keys under inputs can effectively be anything. I can happily parse this into cty.Values, but I've not a found a non-janky way of getting that into an interface{} as I would with unknown json input, for example.
The exact syntax above is one example. I can flex within reason if there's some more supported way of handling this built-in. I could have inputs as a block, or change the structure in other ways if it makes it more feasible.
My main needs are that users can define a structure without having to template json strings (will be error prone and bad user experience), they should have access to the expression context and the top level keys will always be strings.
I've been bashing my head against this for over a day now and I'm basically out of ideas beyond recursively parsing the structure myself. That will work, but it seems others must have faced and solved this ahead of me.
The text was updated successfully, but these errors were encountered:
I'm creating a DSL using HCL, and bumping up against the ability to let users define a (mostly) arbitrary attribute.
Given an example HCL config like so:
The values of the keys under
inputs
can effectively be anything. I can happily parse this intocty.Value
s, but I've not a found a non-janky way of getting that into aninterface{}
as I would with unknown json input, for example.The exact syntax above is one example. I can flex within reason if there's some more supported way of handling this built-in. I could have
inputs
as a block, or change the structure in other ways if it makes it more feasible.My main needs are that users can define a structure without having to template json strings (will be error prone and bad user experience), they should have access to the expression context and the top level keys will always be strings.
I've been bashing my head against this for over a day now and I'm basically out of ideas beyond recursively parsing the structure myself. That will work, but it seems others must have faced and solved this ahead of me.
The text was updated successfully, but these errors were encountered: