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

Terraform 0.10.7 Issue When plan/apply only contains outputs #44

Closed ahosking closed 7 years ago

ahosking commented 7 years ago

Bland terraform output:

aws_efs_mount_target.letsencrypt: Refreshing state... (ID: xxx-xxxxxxx)
aws_route_table_association.public_1c: Refreshing state... (ID: rtbassoc-xxxxxxxx)
aws_route_table_association.public: Refreshing state... (ID: rtbassoc-xxxxxxxx)
aws_route_table_association.public_1d: Refreshing state... (ID: rtbassoc-xxxxxxxx)
aws_route_table_association.public_1b: Refreshing state... (ID: rtbassoc-xxxxxxxx)

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

eip-reserved3 = 00.000.000.000
eip-reserved4 = 00.000.000.000
eip-reserved5 = 00.000.000.000
eip-reserved6 = 00.000.000.000
proxyone = 00.000.000.000

With Landscape: error: Output does not contain proper preface. Use --trace to view backtrace

With Landscape and --trace

/usr/local/bin/landscape
/var/lib/gems/2.3.0/gems/terraform_landscape-0.1.16/lib/terraform_landscape/printer.rb:57:in `process_string': Output does not contain proper preface (TerraformLandscape::ParseError)
    from /var/lib/gems/2.3.0/gems/terraform_landscape-0.1.16/lib/terraform_landscape/printer.rb:35:in `process_stream'
    from /var/lib/gems/2.3.0/gems/terraform_landscape-0.1.16/lib/terraform_landscape/cli.rb:48:in `print'
    from /var/lib/gems/2.3.0/gems/terraform_landscape-0.1.16/lib/terraform_landscape/cli.rb:34:in `block (2 levels) in define_commands'
    from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
    from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
    from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
    from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
    from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
    from /var/lib/gems/2.3.0/gems/terraform_landscape-0.1.16/lib/terraform_landscape/cli.rb:25:in `run'
    from /var/lib/gems/2.3.0/gems/terraform_landscape-0.1.16/bin/landscape:7:in `<top (required)>'
    from /usr/local/bin/landscape:23:in `load'
    from /usr/local/bin/landscape:23:in `<main>'

I use variable output all the time, so I can readily reproduce this error if it helps.

sds commented 7 years ago

Hey @ahosking, thanks for the report!

Looks like this has been fixed in 0.1.17, as I can't reproduce the error using the output you provided.

Feel free to open a new issue with different output if you're still seeing failures!

ahosking commented 7 years ago

@sds thanks. It looks to be fixed indeed!