Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate cost for on-demand instances which are not always on #1556

Closed
DeltaWhy opened this issue Apr 11, 2022 · 3 comments
Closed

Calculate cost for on-demand instances which are not always on #1556

DeltaWhy opened this issue Apr 11, 2022 · 3 comments
Assignees
Labels
aws Issue relates to AWS good first issue Good for newcomers
Projects

Comments

@DeltaWhy
Copy link

My company uses a lot of EC2 instances which only run during business hours and are stopped otherwise. Would it be possible to add an 'hours per month' or 'percent usage per month' field to the usage file to account for this use case?

For instance, we might estimate costs based on 180 hours per month rather than 730 for the instances, but the disk subresources are still charged at the full monthly rate (since we're stopping rather than terminating the instances).

@alikhajeh1 alikhajeh1 added aws Issue relates to AWS good first issue Good for newcomers labels Apr 11, 2022
@alikhajeh1
Copy link
Member

@DeltaWhy great idea - I've heard this a few times from users so thanks for creating the issue! If you'd like to contribute, this seems like a good first issue:

  1. Add monthly_hours to the example usage file (we have this for some of the other resources too).
  2. Add the above param to this
  3. change this to MonthlyQuantity and use the param. The param should default to 730 so the existing behavior continues to work if users don't define the usage param (I suppose we should also validate the param is >0 and <= 730).
  4. Review the other HourlyQuantity mentions in the instance.go file above and see if they should use the same param or, if they should remain as 730 (e.g. do users pay for the Inference accelerator when the instance is stopped?) - if needed we can also help with this by reviewing the AWS EC2 pricing page.

Semi-related to the above change could be to also update the Azure and Google instance resources so instances are consistent across the providers.

Unrelated to this GH issue, this feature'll enable us to get feedback from AWS RDS and other resource users to see if the same thing is needed for those resources.

@alikhajeh1 alikhajeh1 added this to Todo (prioritized top to bottom) in Main via automation May 26, 2022
@alikhajeh1 alikhajeh1 moved this from Todo (prioritized top to bottom) to In progress in Main Jul 20, 2022
@alikhajeh1
Copy link
Member

@hugorut plz close this after v0.10.8 is live as it looks like it's being released as part of that.

@hugorut hugorut added the next release Issue will be resolved with the next release of Infracost. label Jul 20, 2022
@hugorut
Copy link
Contributor

hugorut commented Jul 20, 2022

hey @DeltaWhy , the v0.10.8 release has added support for a monthly_hours usage field for AWS, Azure & GCP VMs. Could you check that out and see if this solves your problem? Thanks

@hugorut hugorut removed the next release Issue will be resolved with the next release of Infracost. label Jul 20, 2022
Main automation moved this from In progress to Merged to master Aug 3, 2022
@tim775 tim775 moved this from Merged to master to Released in Main Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Issue relates to AWS good first issue Good for newcomers
Projects
Main
Released
Development

No branches or pull requests

3 participants