coinbase / terraform-landscape

Improve Terraform's plan output to be easier to read and understand
Apache License 2.0
1.59k stars 116 forks source link

Another weird terraform format #19

Closed glenjamin closed 7 years ago

glenjamin commented 7 years ago

This one seems to be produced when a data source depends on the result of some other resource.

main.tf

resource "template_file" "demo" {
    template = <<EOF
{
    "a": 1,
    "b": 2
}
EOF
}

data "external" "ext" {
    program = ["echo", "{}"]
    query {
        stuff = "and nonsense"
        dependent = "${template_file.demo.rendered}"
    }
}

output

<= data.external.ext
    program.#: "2"
    program.0: "echo"
    program.1: "{}"
    query.%:   "<computed>"
    result.%:  "<computed>"

+ template_file.demo
    rendered: "<computed>"
    template: "{\n    \"a\": 1,\n    \"b\": 2\n}\n"

In this particular example, there's no error - it just gets missed.

If it's not the first item, there is a parse error.

error: Expected one of '~', '-/+', '-', '+', "\n"