Show HN: Infracost (YC W21): Cloud Costs for Terraform in VSCode
Over the last few months, I've been working on a native evaluation for Terraform. Previously we relied on the Terraform CLI to fetch cloud resource information, which was a little slow and cumbersome.
Native parsing is not only lightning-fast, but it means we have contextual file information, which allows us to try a load of cool new things. For example, we could provide real-time suggestions to optimise your cloud costs as you write your infrastructure code! This VSCode extension is the result of a few weeks of hacking away whilst I should have been relaxing in the sun in Italy... time better spent, I think!
We're excited about the possibilities of directly integrating with editors. There is so much we can do to make DevOps lives easier when optimising cloud spend. Right now, we're looking for your feedback on this initial version of the extension. It currently ships with:
1. Show a snapshot of the total cost of resources right above their Terraform definitions. Updated on file save.
2. Resource and module blocks support showing cost estimates, including 3rd party module blocks.
3. A cost overview web-view shows a detailed breakdown of what components affect the price.
Please note this is an early release of the VSCode extension, so there will likely be bugs. If you get stuck, please raise an issue (https://github.com/infracost/vscode-infracost/issues), and we'll help you out asap.
We’d love to get your feedback on this extension, mainly what you think it’s missing and would help your workflow. Head over to the GitHub repo (https://github.com/infracost/vscode-infracost) for more information and installation instructions.
35 comments
[ 7.9 ms ] story [ 98.5 ms ] threadSeeing this, I thought that's cool and it's something I really want to start using! Thanks!
[1] https://www.terraform.io/cloud-docs/cost-estimation
https://github.com/aws-cloudformation/cloudformation-coverag...
Can't find a blog detailing exactly when it launched, but here's a file from an AWS SDK in 2011 with it:
https://github.com/aws/aws-sdk-java/blob/2b08c776c16fc1c8f58...
One question, do you support, or maybe are planning to support usage-based pricing? Stuff like Lambda invocations.
It's a common use-case and I think it's a tough nut to crack with your architecture, so wondering if you came up with something for that.
The other data source we can tap into is the actual billing data, e.g. AWS Cloud and Usage Reports - if you have any thoughts/preferences, checkout https://github.com/infracost/infracost/discussions/985#discu...
what happens when the cloud vendor update their pricing strats?
We don’t have strict rules around this but it would be easy to add some policy checking to block any change that is surprisingly expensive.
I ran the tool on one of my projects' terraform files and it came out with a huuuuge list of infrastructure along with summaries like "Monthly cost depends on usage: $0.026 per GiB". But the grand estinated total cost of this entire project was: $0 per month...
That's the tricky bit, you can't really estimate the cost of this stuff without doing napkin maths on usage. I don't really see how you'd be able to improve this situation, either.
I'm glad someone is trying to bring better transparency to cloud costs. I think this would be a cool thing to add in a terraform CI pipeline. For example: you could allow your devs to be more agile when prototyping by allowing them to change terraform in dev without approval, assuming the MR doesn't add more than $XYZ in costs per month.
I have to assume they could model some projections based on your current usage, and give you that? Predicting the future is hard, of course, but if their algorithm is simple & basic enough to understand, it'd surely be quite helpful, no?
But you're right that it needs usage data, or models of usage data... For now, the CLI can fetch usage data from the cloud APIs for S3/Lambda/Dynamo and show engineers that functionX was invoked 2M times in the last 30 days: https://www.infracost.io/docs/features/usage_based_resources...