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

Issue running plan in terraform v0.10.7 #43

Closed somanianshul closed 7 years ago

somanianshul commented 7 years ago

terraform_landscape (0.1.16, 0.1.14)

Terraform output when there is no change in infrastructure:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

aws_vpc.poc: Refreshing state... (ID:   ##vpc-xxxxxxxxxxxxx)
data.aws_iam_policy_document.flowlogs: Refreshing state...
data.aws_iam_policy_document.rds_assume_policy: Refreshing state...
data.aws_iam_policy_document.flowlogs_assume_role_policy: Refreshing state...
aws_iam_role.rds: Refreshing state... (ID: xxxxxxxxxxxxxxxxxRole)
aws_iam_role.flowlogs: Refreshing state... (ID: xxxxxxxxxxxxxxRole)
aws_iam_role_policy.flowlogs: Refreshing state... (ID: xxxxxxxxxxxxxCreatePolicy)
aws_iam_role_policy_attachment.rds: Refreshing state... (ID: xxxxxxxxxxxxxxRole-20171030050803915500000001)

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.

When running with landscape:

error: Expected [ ] at line 2, column 2 (byte 3) after
-. Use --trace to view backtrace

trace:

/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/lib/terraform_landscape/terraform_plan.rb:36:in `from_output': Expected [ ] at line 2, column 2 (byte 3) after  (TerraformLandscape::TerraformPlan::ParseError)
-
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/lib/terraform_landscape/printer.rb:66:in `process_string'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/lib/terraform_landscape/printer.rb:35:in `process_stream'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/lib/terraform_landscape/cli.rb:48:in `print'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/lib/terraform_landscape/cli.rb:34:in `block (2 levels) in define_commands'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/lib/terraform_landscape/cli.rb:25:in `run'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/gems/terraform_landscape-0.1.16/bin/landscape:7:in `<top (required)>'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/bin/landscape:22:in `load'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/bin/landscape:22:in `<main>'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/anshul/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'
sds commented 7 years ago

Hey @somanianshul, thanks for the report. Can you format the output in backticks (```) so that we can determine which part of the output is from Terraform and which is your own formatting? It would help us debug this issue.

Given how you've formatted this, I can't quite tell if your output contains a dashed line or is formatted to have a horizontal rule. Appreciate you clarifying here by fixing the output. Thanks!

somanianshul commented 7 years ago

Hey @sds Hope this helps.

adrienkohlbecker commented 7 years ago

Hey folks! :wave: Any update on this? 🙂

simonvanderveldt commented 7 years ago

I just tried 0.1.17 and still have this issue. Is it working for any of you?

sds commented 7 years ago

Hey @simonvanderveldt, I can't reproduce the issue with the latest version of Terraform Landscape (0.1.17 at time of writing) using the output provided above.

If you're hitting an issue, it's likely a different one. Please capture the output of your command (terraform plan ... > out.txt) and post the contents of the output in a new issue so we can reproduce the problem. Thanks!