Now we have this running, and we have an idea of what we want to support with this, we spoke about refactoring this, to make it easier to change, as the single file is doing a bunch of work:
A proposed structure
We discussed breaking this into three smaller components, like this picture here:
CLI parser - this takes care of setting attributes based on the flags we pass in on the command line
filter/grouper - this takes the data we care get back from cost explorer, and reshapes it so it's easy to represent in json, CLI output, on a page, and so on
formatter - this takes the datastructure we generate with the component above, and takes care of formatting it in the chosen output format (i.e. as a json file, as html, or a terminal table)
Now we have this running, and we have an idea of what we want to support with this, we spoke about refactoring this, to make it easier to change, as the single file is doing a bunch of work:
A proposed structure
We discussed breaking this into three smaller components, like this picture here: