Open mrchrisadams opened 5 years ago
After chatting, we'll use meow, instead of commander.
Mapbox already use it, and well… better gifs.
After convo, we're punting the tag decisions till we have first part built, and see how ppl use it.
This is the API we agreed on
greencost
by itself, to get the summary output--help
to get hints like what we outline here--by-month
to get the monthly breakdown--by-service
to get the per service breakdown--by-region
to get the per region breakdown--html
to output as a chart you can see in browser (ideally using a charting library, like vega-embed)--json
to get json for consuming in other systems (this is mutually exclusive with --html
) At the moment the utility throws an error since the dates that are hard coded request data that's more than 12 months ago, which the API does not support.
Thanks for changing the hard coding, @edsu.
I based on on the extra bits, I'm going to leave this open in the hope that me, or some kind soul from the internet is able to add the parsing of flags for specific dates 👍
Right now the we have hard coded dates for running checks.
There's a normal 1 year rolling window I think for cost explorer, but it would be nice to set the time bounds, like you can with the python cli.
For example, when you have this:
I would be good to do something to either use the same kinds of flags:
Or ideally use flags like so, which
I'm not sure what the convention is for node js, but if we know we only ever have maximum of today plus one year back, we might be able to have some sensible defaults to show the last year of spend analysis, or be able to set arbitrary figures like so:
I'm not sure what the most command CLI tool for node is, but commander looks well documented, and is used by the Vue CLI, so there's code examples we can look to for seeing how different things are implemented
https://www.npmjs.com/package/commander
Bonus bit
If filtering by tags is simple, then it gives us a nice way to restrict a query to a single project team.
https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetCostAndUsage.html#API_GetCostAndUsage_RequestSyntax