Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

json: cannot unmarshal object into Go value of type string // Show Inputs and Outputs of External Data Command #8

Open
hashibot opened this issue Jun 13, 2017 · 0 comments
Labels

Comments

@hashibot
Copy link

This issue was originally opened by @Miserlou as hashicorp/terraform#13991. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.9.3

Affected Resource(s)

  • data.external

Terraform Configuration Files

data "external" "template" {
  program =  ["zappa", "template",  "-r", "'${aws_iam_role.iam_for_my_lambda.arn}'", "-l", "'${aws_lambda_function.my_lambda.arn}'", "--json"]
  depends_on = ["aws_lambda_function.my_lambda"]
}

Debug Output

* data.external.template: data.external.template: command "zappa" produced invalid JSON: json: cannot unmarshal object into Go value of type string

Expected Behavior

The error shows the command which was executed and the output of that command.

Actual Behavior

I receive no useful information about the arguments of the executed command, or the output which failed to be parsed to JSON.

I don't now if this is a "Terraform-can't-parse-valid-JSON" bug, or a "My-program-pooped-the-bed" bug, because the output has no useful information in it, which makes it a "Terraform should be more helpful here in the UX department" bug.

Steps to Reproduce

  1. Create a complex command.
  2. terraform apply

Important Factoids

Running the command manually in my terminal produces valid JSON.

@hashibot hashibot added the bug label Jun 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant