Hi folks, I have a bit of a weird problem. When I ...
# help
c
Hi folks, I have a bit of a weird problem. When I do a:
Copy code
terraform plan-out tfplan.binary
terraform show -json tfplan.binary > plan.json
infracost breakdown --path plan.json
Infracost responds correctly with an output of ~ $9k USD
but if I follow the recommended:
Copy code
infracost breakdown --path . --terraform-var-file alpha-prod.tfvars
It responds with an output of ~ $48k USD It seems to be counting RDS instances 26 times - any ideas?
b
Hello! Are you able to run Infracost against your TF code? To compare the results. To answer your question we’d need a way to reproduce it - sharing the piece of the code (sanitizied of course) and tfvars would help a lot
c
Thanks for coming back to me, unfortunately I don't think my customer will allow that. Their terraform is a bit of a spaghetti sandwich, with multiple layers of modules.
It just seems a little peculiar that both RDS instances are showing exactly the same number of instances (25) when I don't do the plan and feed that into infracost.
b
If you're using count/foreach blocks and the count comes from a data input, we might not mock it correctly (as we can't read the data), thus it gets parsed incorrectly and we probably get the length of the string as a value (in your case it's a 25 character string). It's just a guess though
c
Ah that’s a possibility. There’s definitely some data sources being thrown around in the mix.