hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.42k stars 9.51k forks source link

0.13 terraform graph output error with graphviz #25237

Closed danieldreier closed 4 years ago

danieldreier commented 4 years ago

Terraform Version

Terraform v0.13.0-beta1

Terraform Configuration Files

resource "null_resource" "test" {}

Expected Behavior

When I run a terraform graph of a trivial null_resource on 0.12.26, I get the following output:

digraph {
        compound = "true"
        newrank = "true"
        subgraph "root" {
                "[root] null_resource.test" [label = "null_resource.test", shape = "box"]
                "[root] provider.null" [label = "provider.null", shape = "diamond"]
                "[root] meta.count-boundary (EachMode fixup)" -> "[root] null_resource.test"
                "[root] null_resource.test" -> "[root] provider.null"
                "[root] provider.null (close)" -> "[root] null_resource.test"
                "[root] root" -> "[root] meta.count-boundary (EachMode fixup)"
                "[root] root" -> "[root] provider.null (close)"
        }
}

When I run this on 0.13.0 beta 1, I get the following output:

digraph {
        compound = "true"
        newrank = "true"
        subgraph "root" {
                "[root] null_resource.test (expand)" [label = "null_resource.test", shape = "box"]
                "[root] provider["registry.terraform.io/hashicorp/null"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"]
                "[root] meta.count-boundary (EachMode fixup)" -> "[root] null_resource.test (expand)"
                "[root] null_resource.test (expand)" -> "[root] provider["registry.terraform.io/hashicorp/null"]"
                "[root] provider["registry.terraform.io/hashicorp/null"] (close)" -> "[root] null_resource.test (expand)"
                "[root] root" -> "[root] meta.count-boundary (EachMode fixup)"
                "[root] root" -> "[root] provider["registry.terraform.io/hashicorp/null"] (close)"
        }
}

On 0.12.26, when I run terraform graph | dot -Tsvg > graph.svg a svg file is generated.

Actual Behavior

On 0.13.0 beta 1, I get:

terraform graph | dot -Tsvg > graph.svg
Error: <stdin>: syntax error in line 6 near '.'

Steps to Reproduce

terraform init
terraform apply -auto-approve
terraform graph
terraform graph | dot -Tsvg > graph.svg

Additional Context

I encountered this while trying to reproduce https://github.com/hashicorp/terraform/issues/14511 on 0.13.0 beta 1.

References

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.