[HN Gopher] Show HN: See the impact on your cloud costs as you code
___________________________________________________________________
Show HN: See the impact on your cloud costs as you code
Hey folks, my name is Owen and I recently started working at a
startup (https://infracost.io/) that shows engineers how much their
code changes are going to cost on the cloud before being deployed
(in CI/CD like GitHub or GitLab). Previously, I was one of the
founders of tfsec (it scanned code for security issues). One of the
things I learnt was if we catch issues early, i.e. when the
engineer was typing their code, we save a bunch of time. I was
thinking ... okay, why not build cloud costs into the code editor.
Show the cloud cost impact of the code as the engineers are writing
it. So I spent some weekends and built one right into JetBrains -
fully free - keep in mind it is new, might be buggy, so please let
me know if you find issues. It is check it out:
https://plugins.jetbrains.com/plugin/24761-infracost I recorded a
video too, if you just want to see what it does:
https://www.youtube.com/watch?v=kgfkdmUNzEo I'd love to get your
feedback on this. I want to know if it is helpful, what other cool
features we can add to it, and how can we make it better? Final
note - the extension calls our Cloud Pricing API, which holds 4
million prices from AWS, Azure and GCP, so no secrets, credentials
etc are touched at all. If you want to get the same Infracost
goodness in your CI/CD, check out https://www.infracost.io/cicd
Author : rumno0
Score : 108 points
Date : 2024-08-13 13:00 UTC (10 hours ago)
| bearjaws wrote:
| This is amazing, I think it's best applied at CI/CD first, but
| having the plugin is good too for ICs to get it into a company.
|
| How "smart" is it? Say I make a copy of a large database in TF
| and redeploy it into a staging env, will it know that the storage
| is $200 a month?
|
| Also maybe put the supported clouds on the front page? I work
| multi-cloud so was worried it was only AWS.
| rumno0 wrote:
| Hey - great feedback!!
|
| If you're using tfvars for your envs, its "smart". With easily
| inferable env names for tfvars, we will generate estimations
| for each env.
|
| In the video, I give an example where for the prod env, I turn
| on multi-az and have a larger storage and the price goes up.
|
| Good suggestion about supported clouds, I'll update!
| manmal wrote:
| Looks great! The markdown link to your site is broken.
| rumno0 wrote:
| All fixed, appreciated!
| Namret wrote:
| The main page doesn't mention Terraform explicitly (except for
| the user feedback section). Are there plans to make this
| compatible with e.g. AWS CDK or Pulumi?
| rumno0 wrote:
| Yes, we have got quite a lot of requests for those. On the
| roadmap for sure!
| fulafel wrote:
| Could similar be done for co2 emissions?
| ctxc wrote:
| If I may dare - that would be a novelty while this is something
| many would pay for.
|
| If it's just a straightforward conversion, then sure...
| rumno0 wrote:
| There was an interesting page on the FinOps Foundation site
| about this https://www.finops.org/wg/sustainability/
|
| There is a potential intersection, but that might have to go
| further down the roadmap
| geewee wrote:
| Something similar (but not quite the same) exists through
| sources like CCF ( https://www.cloudcarbonfootprint.org/ ) or
| Climatiq ( https://www.climatiq.io/docs/api-reference/computing
| ) thought I don't think anyone has anything built-in to
| Terraform or your editor, which would be neat.
|
| Disclaimer: I work at Climatiq
| eloisant wrote:
| Usually CO2 emissions correspond to cloud costs. Optimize your
| cloud costs, you optimize your emissions.
| fulafel wrote:
| This spiritual kin of the efficient market hypothesis
| mindset. But it's not like that, if you look at pricing at
| cloud provider regions and vs local electricity mix off
| Electricity Maps. (eg Ireland vs nordic countries)
| paxys wrote:
| I was half hoping this would tell me how many dollars worth of
| CPU cycles my shitty code was wasting for no reason.
| rumno0 wrote:
| That sounds like an idea for my next plugin :thinking:
| selamtux wrote:
| that what i thinking, after some job interview i realized
| nobody gives a shit how many cpu cycle you use, they only care
| about jira points.
| ai4ever wrote:
| This is nice but not very useful to me. What would be more useful
| in my use case is tooling to audit my cloud accounts periodically
| and reclaim garbage which is not used or re optimize my usage
| (smaller instances or databases depending on usage patterns)
| which directly saves me money.
| rumno0 wrote:
| I think this is the next natural evolution - bring in usage
| information directly from the cloud accounts then offer right-
| sizing suggestions and, like you say, reclaim garbage on
| demand.
|
| Definitely one for the road map!
| Gasp0de wrote:
| Determining accurately if we can safely scale down an instance
| is one of the hardest things we do, I can not think of a way to
| determine this in an automated fashion.
| rumno0 wrote:
| I agree - there will always be an element of engineering
| knowledge required.
|
| It's not dissimilar to AWS urging people to use Flex or
| Graviton instances, only we can decide if our workload will
| run appropriately!
| tamiral wrote:
| performance testing? metrics analysis?
| nathanwallace wrote:
| For runtime cost analysis, you could try Steampipe [1] with
| it's Powerpipe "thrifty" [2] mods. They run dozens of automatic
| checks across cloud providers for waste and cost saving
| opportunities.
|
| If you want to automatically make these changes (with optional
| approval in Slack) you can use the Flowpipe thrifty mods, e.g.
| AWS [3].
|
| It's all open source and easy to update / extend (SQL, HCL).
|
| 1 - https://github.com/turbot/steampipe 2 -
| https://hub.powerpipe.io/?objectives=cost 3 -
| https://hub.flowpipe.io/mods/turbot/aws_thrifty
| aduwah wrote:
| Steampipe is amazing. I am using it daily for about 4 months
| now
| eloisant wrote:
| Datadog Cloud Cost Management does that:
| https://www.datadoghq.com/product/cloud-cost-management/
|
| (disclamer: I know about it because work for Datadog, I'm sure
| there are other competiting products that do the same)
| denvrede wrote:
| Does it have Terragrunt (*.hcl) support? I see it mentioned no
| where but the infracost CLI has
| (https://www.infracost.io/docs/features/terragrunt/).
| rumno0 wrote:
| The plugin is using the CLI under the hood - so it should work
| as if you're using the CLI
| denvrede wrote:
| Mhm doesn't seem to work. It's not recognizing the
| terragrunt.hcl
| rumno0 wrote:
| oh okay, that's a shame. I'll put together a simple
| terragrunt and see what's going on
| jiehong wrote:
| Congrats!
|
| It's almost a REPL for cloud costs! Amazing!
| rumno0 wrote:
| Thanks!!
| da768 wrote:
| Do you plan to take discounts into account?
|
| Can you base usage off previous billing data for existing
| resources?
| rumno0 wrote:
| We support custom price books -
| https://www.infracost.io/docs/infracost_cloud/custom_price_b...
|
| As for usage, at the moment it's driven from a usage file -
| https://www.infracost.io/docs/features/usage_based_resources...
|
| In the future, we'd like to infer usage directly from the cloud
| account to give the most accurate view and do right size
| suggestion
| rbro wrote:
| Looks great based on the video!
|
| As a data engineer in a consulting company: this would be a good
| way to get an idea of cost once we've written infra for projects.
|
| Couple of questions:
|
| 1. Is Bicep supported?
|
| 2. Any plans for a VS Code plugin? (I just saw in your docs you
| have a plugin for this, great!)
|
| 3. How are you handling pricing of resources that are dependent
| on consumption?
| rumno0 wrote:
| 1. Not at the moment, but we're looking at other IaC tools to
| support on the road map.
|
| 2. There is a vscode extension -
| https://marketplace.visualstudio.com/items?itemName=Infracos...
|
| 3. That is a challenge, we use usage files, but in the future
| would like to pull it from the cloud account to be more
| accurate and the best suggestions.
| https://www.infracost.io/docs/features/usage_based_resources...
| mrg3_2013 wrote:
| Looks interesting! I think cost of running resources would be
| more helpful
| rumno0 wrote:
| Thanks, that's generally more readily available in the billing
| explorer for most cloud providers.
|
| There is a definite case for pulling usage data from the cloud
| account to make suggestions about right sizing though, that's a
| definite roadmap item
| xhkkffbf wrote:
| How crisp are the estimates of cost? I can see how they might
| depend heavily upon the dataset, especially when the algorithms
| are supralinear like O(n^2) or O(n^3).
| rumno0 wrote:
| Our cost api is very regularly updated from the pricing data
| made available by the cloud providers.
|
| Metadata about the resources that require cost estimation are
| rolled up and sent to the pricing API, it's generally pretty
| quick process even with large projects
| jbs789 wrote:
| I have more macro questions about this. Sometimes I find
| engineers aren't best placed to evaluate cost at all. What might
| be perceived as expensive (say relative to a salary) is not
| expensive at all in the context of the business problem being
| solved.
|
| Think there's a book called "measure what matters" and the idea
| is what we measure shapes companies and behaviour. So I'd be very
| careful about implementing anything like this in my org.
| rumno0 wrote:
| You're right, there are multiple roles for FinOps in an
| organization from the engineer up to finance and engineering
| management.
|
| This is tackling one aspect of this - highlighting the cost to
| the engineer.
| delusional wrote:
| I'd be careful about implementing it without the appropriate
| support at least. The cheapest option is to do no work, that's
| not going to get you very far. The cost of the infra always has
| to be held up against the value of the product.
| gopher_space wrote:
| In this context I'd expect cost to relate to hardware and
| bandwidth. Simplest example might be bucketing memory or
| storage requirements against the different tiers of offerings.
|
| Personally, baking this kind of spreadsheet work into a
| pipeline was a moderate pain in the butt and hazardous to fully
| automate.
___________________________________________________________________
(page generated 2024-08-13 23:02 UTC)