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

error: undefined local variable or method `host' for #<TerraformLandscape::TerraformPlan:0x00007ff6dea84530>. #62

Closed andrewhertog closed 6 years ago

andrewhertog commented 6 years ago

Getting this error now with recent release of terraform aws provider version 1.33.0.

error: undefined local variable or method `host' for #<TerraformLandscape::TerraformPlan:0x00007ff6dea84530>.

Please see https://github.com/terraform-providers/terraform-provider-aws/issues/5661 for expanded details and stack trace

jianyuan commented 6 years ago

It's probably due to the fact that the new fixed-response config values contain valid Ruby string interpolation variables which are evaled by terraform-landscape.

Culprits:

I do question the use of evals as it poses a security concern.

References:

sds commented 6 years ago

Totally agree about the use of eval. You can see that I explicitly ignore the security warning.

This was a quick solution to a problem, and it's clear we've outgrown it. The proper solution is to create a Treetop grammar to parse the hashrocket-style attribute declarations.

Would love help with this!

robacarp commented 6 years ago

Given that this isn't security software and therefore doesn't need to deal with malicious input data in the same way a search engine does, a full grammar is probably overkill. Could this be kicked down the road by simply running a quick and dirty escape on the input string, converting #{ into ${?

dozen commented 6 years ago

I tried submitting PR to fix this problem: #73

sds commented 6 years ago

Fixed in #73