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

Billing: handle RECORD_TYPE via filter or group_by #72

Open
ateucher opened this issue Aug 22, 2024 · 1 comment · May be fixed by #74
Open

Billing: handle RECORD_TYPE via filter or group_by #72

ateucher opened this issue Aug 22, 2024 · 1 comment · May be fixed by #74

Comments

@ateucher
Copy link

ateucher commented Aug 22, 2024

Love where this package is going, so nice to see a "humane" approach to interacting with AWS!

I am using the billing functions, which to this point I have been rolling for myself. The aws_billing() is great for its simplicity, and I wonder if it can be more generalizable.

My specific use-case is that in our current account, all of our usage is paid for by credits as the usage occurs. By default, the cost explorer API returns net costs by time period aggregated over all charge types, so our net daily cost comes out as zero (== usage - credits). I can deal with this in two ways - add a GroupBy parameter so it groups by RECORD_TYPE (list(Type = "DIMENSION", Key = "RECORD_TYPE")), and then I can filter locally to just get usage records. Or I can add a Filter statement to the CE query to just get RECORD_TYPE == "Usage", which is what I am currently doing.

Apparently only two values for GroupBy are allowed, and since GroupBy already has two values in billing_factory(), I wonder if allowing a user to pass a filter in through aws_billing() to aws_billing_raw() would be desirable? It actually looks like the plumbing was started as there is an unused filter argument already there.

I'd be happy to start a PR if this would be of interest?

(PS Hey @sckott 👋! And @seankross - hopefully you don't start to regret asking me to kick the tires! 😉)

@sckott
Copy link
Member

sckott commented Aug 26, 2024

Thanks for kicking the tires Andy! (👋🏽 , talked to Stef and Sam at posit conf, missed seeing you)

Yeah, please submit a PR and we'll talk about it. I imagine @seankross does have a vision for the billing interface, so do chime in Sean if you have a feeling on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants