cycloidio / terracost

Cloud cost estimation for Terraform in your CLI
MIT License
286 stars 30 forks source link

Plan variables are forced to be `string` #86

Closed xescugc closed 1 year ago

xescugc commented 1 year ago

For some reason we forced the plan.variables to have the value of type string, this was causing errors like

Error: unable to estimate terraform plan file: unable to estimate cost insfrastructure: [ Unexpected message from the external service Cost Estimation: json: cannot unmarshal object into Go struct field Variable.variables.value of type string]

Error: unable to estimate terraform plan file: unable to estimate cost insfrastructure: [ Unexpected message from the external service Cost Estimation: json: cannot unmarshal bool into Go struct field Variable.variables.value of type string]

We'll fix this by changing the type to interface{} and casting it to string when we need to.