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
feat: add monthly_hrs usage field for aws/azure/gcp VMs #1812
feat: add monthly_hrs usage field for aws/azure/gcp VMs #1812
Conversation
At its core this is a pretty straightforward PR, but the myriad golden file updates have made it appear larger than it is. Happy to break this up into a separate PR each for AWS / Azure / GCP resources, if the maintainers prefer. Looking forward to getting feedback and getting this landed! |
Thanks for the contribution @jessecureton 🙏! One of our team will look at this in the next couple of days. |
Sounds good! I took a look at the failing test case in the CI checks and it seems unrelated to this change. I did notice the failing test case (
Locally running |
@jessecureton you're correct. I pushed a fix to skip this test in #1809, but I think there might still be issues here I haven't had a chance to investigate today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jessecureton, this looks great 🙂. Two minor points below.
- I think we should we use
monthly_hrs
to be consistent with the other*_hrs
usage keys. - Should it be a float value for the use-case if a user only runs the instance for a few minutes in the month?
I used
This seems reasonable! I will make this change alongside the above once I hear back re: the preferred syntax |
Yeah we definitely have inconsistencies at the moment 😞 and at some point we should migrate those to be consistent. For now we should use |
I've updated this to include both the requested changes for float values and the switch to monthly_hrs! Thanks for the link to the policy doc for naming, I had missed that initially! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jessecureton, this looks great! I'll rebase and run the tests, to make sure they all pass.
a207a1f
to
36f8ca1
Compare
* first pass at ec2 instance monthly hours * add monthly hour usage example to golden files * handle usage quantities for other aws cost components * update goldens * remove unsupported elastic inference accelerator test cases * support monthly_hours on azure vm resources * add google cloud compute instance hourly usage * fix a missed bit of formatting * update usage golden files and add makefile aliases for them * update usage field names to use _hrs * use floats to allow decimal monthly_hrs values
Updates the following resource types to support a
monthly_hrs
usage flag:aws_instance
azurerm_virtual_machine
azurerm_linux_virtual_machine
azurerm_windows_virtual_machine
google_compute_instance
This addresses #1556.