steampipe-plugin-aws icon indicating copy to clipboard operation
steampipe-plugin-aws copied to clipboard

Add table for aws_ec2_instance - Ondemand Cost

Open sankeyraut opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. Add a column for ondemand hourly cost of the EC2 instance or a separate table will also help.

Describe the solution you'd like When we query the ec2 api, we would like to have a mechanism to get the hourly cost of the EC2 instance. (irrespective of lifecycle). AWS Pricing API can be used here.

https://docs.aws.amazon.com/sdk-for-go/api/service/pricing/

Describe alternatives you've considered Alternate option is to use cost explorer API.

Additional context Add any other context or screenshots about the feature request here.

sankeyraut avatar Aug 25 '21 08:08 sankeyraut

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Dec 17 '21 23:12 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Mar 13 '22 23:03 github-actions[bot]

Hi @sankeyraut , I'm sorry that we took so long to respond to this issue (almost 9 months)!

We do have a few cost tables available, like the aws_cost_by_service_daily or aws_cost_by_service_usage_type_daily, which can help you get cost across accounts or across an organization when querying the organization management account.

If you're using reserved instances, we also have some cost data in various columns in the aws_ec2_reserved_instance.

After briefly looking at the Pricing API, the APIs feels rich enough that we'd most likely create separate tables to retrieve this data. For instance, as the Pricing APIs support filter capabilities, having separate tables with helpful key columns would allow for more efficient queries.

In regards to pricing data, is specific EC2 instance cost data the primary thing you're looking for? Are you typically looking to query this data for specific EC2 instances that exist, or do you have EC2 instance types in mind that you want to retrieve pricing data for?

Also, once you have pricing data for each instance, how do you plan to use this data? Would you take this pricing data and use it in another query, dashboard, or somewhere else? Or is this something you'd like to be able to see ad-hoc as you run other queries?

cbruno10 avatar May 04 '22 20:05 cbruno10

@bigdatasourav I think the addition of pricing tables may help us estimate costs for running EC2 instances based on type/region as part of the AWS Thrifty mod. Can you please have a look at the pricing APIs and see what table(s) we can create that would be helpful for new benchmarks/controls/dashboards in the AWS Thrifty mod?

cbruno10 avatar Jun 01 '22 16:06 cbruno10

I'll throw in my vote for adding a table based on the pricing API. But it shouldn't be just EC2 -- all AWS resources should be included. I'm working on an cost analysis in advance of some RDS updates, and it would be nice if I had hourly cost (on demand as well as reserved or savings plan, as appropriate). The existing cost tables are a good way to get the aggregated data, but it would be nice to see the hourly cost per resource.

yshollander-selerity avatar Jun 27 '22 18:06 yshollander-selerity

'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

github-actions[bot] avatar Sep 26 '22 23:09 github-actions[bot]

'This issue was closed because it has been stalled for 90 days with no activity.'

github-actions[bot] avatar Oct 27 '22 23:10 github-actions[bot]