Multi-value output using external data source

Essentially I’m trying to get a list of JSON objects for an output from an external data source. Currently I receive an error: Result Error: invalid character ‘{’ after top-level value. It seems like I might be having a problem with my JSON formatting but I just wanted to know if it’s possible to get multiple values from one output using an external data source.

I am able to output the first value in the list of JSON objects.

Hi @taylor.hendricks,

The external data source in the hashicorp/external provider only allows string values in the JSON object printed by the external program. That is a limitation of the provider itself, so the only recourse would be to make your external program encode data as strings and then transform it into another structure inside your module.

For example, you can make your external program produce a JSON string containing another JSON document, and then decode that nested document in the Terraform language using jsondecode.

Okay that’s what I was thinking. Thank you for the reply and insight, I will take this and get the ball rolling!