Skip to content
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

Document what JSON types are permitted #131

Open
pauldraper opened this issue Feb 19, 2024 · 1 comment
Open

Document what JSON types are permitted #131

pauldraper opened this issue Feb 19, 2024 · 1 comment

Comments

@pauldraper
Copy link

I tried outputting a JSON string for create. Didn't work.

I tried outputting a JSON object. That worked.

It would be good to documentation what JSON types are permitted.

@sunevnuahs
Copy link

I think the detail of what can be used for output is best described in the data source docs where it states:

"The JSON can be a complex nested JSON, but will be flattened into a map[string]string. The reason for this is that your JSON payload variables can be accessed from the output map of this resource and used like a normal terraform output, so the value must be a string. You can use the built-in jsondecode() function to read nested JSON values if you really need to.".

Docs could certainly be better for this; the example referenced in the tests is:

{ "commit_id": "b8f2b8b", "environment": "$yolo", "tags_at_commit": "sometags", "project": "someproject", "current_date": "09/10/2014", "version": "someversion" }

As it states, needs to be flattened into map[string]string, so a simple json string would need to also be output as the most basic map of key/value.

{ "somestringkey": "somestringvalue" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants