-
Notifications
You must be signed in to change notification settings - Fork 673
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
schematics_output data source formats lists incorrectly #1413
Comments
The usage of
|
I was running into a similar issue and found a workaround for this: My problem was that a map I wanted to re-use was also flattened and had their keys kind of merged with the keys of the output_values map. The result looked like this:
My workaround here was to use jsonencode() on the map (which in my case was called Output of the source module:
main.tf of the calling module:
This works for maps and should also for lists and complex objects IMO. The only thing which might be a problem is when jsondecode() does not parse what you expect. Hope this helps |
We don't have any dynamic datatypes in Terraform we introduced a new attribute "output_json" which return's the complete json as string. Now user can use jsondecode and jsondecode functions to work with json output |
ibm_schematics_output.output_values incorrectly returns the outputs of a workspace in the internal golang representation of a Terraform map(list) object. This makes it not possible to access the output values for outputs that were lists in the original workspace by using the built in Terraform variable functions. 'output_values' is returned as a list of map(strings), whereas for list outputs it should be list of map(list).
Flattening the list in this fashion stops output values from one workspace being imported and used in another workspace. Which is the purpose of the schematics_output datasource.
This is with TF0.12 and provider 1.5.1.
data.ibm_schematics_output.output_values returns:
Each list has been flattened into multiple key value pairs. There is no function in Terraform to convert this back to a list to be used as variable input for the workspace.
The original workspace output was:
the result of data.ibm_schematics_output.output_values should be to allow it to be accessed as a Terraform map object :
The text was updated successfully, but these errors were encountered: