Is anyone running any kind of command to update th...
# help
Is anyone running any kind of command to update their TF module
files with a table from infracost? I would like to have it work in the same fashion as like
and just run a command before every commit to have it update the README with a table of cost in the same place on the README every time. Thoughts?
I think @jolly-pilot-68525 talked about a similar thing, @strong-beard-24103 showed me a repo where he manually does that for modules so the users know rough costs. @mysterious-teacher-68276 is working on a PR to make work with Infracost so a readme badge can be added…
here’s a sneak preview, it’ll probably ship next week:
Yah, I just do it manually. An automated way would be epic!
Yeah agree, I was thinking it would work just like terraform-docs in a pre-commit hook but a badge would do the job as well.
w integration is what we’re shooting for so it’s super easy for anyone to copy/paste the badge code and get the automated cost estimate in all of their repos
I'll have to update around 100 repos 😅
I guess the win is that you update them once and forget about it as the badge is automatically updated (and links to the repo page so ppl can see the summary and breakdown details) - maybe in the future we can even allow them to play with the module inputs on the cost estimate page so they get a more accurate module cost estimate before they deploy it
Playing with the inputs would be great. That'd be even better than the AWS calculator for me when estimating stuff
Does anyone know if the infracost cli will output in a markdown format? I see table, html, and json is there a command or beta something I can use that would output a "markdown table"?
It looks like the example on this issue just puts the "table" output into a code block. That might actually work.
Yeah I’ve seen users take the
--format table
and put it into a code block in markdown. The
infracost output --help
command shows the other
options, the
one is markdown too (it’s the markdown that’s used to post the PR comment, so it’s more for diffs and not breakdowns).
I am 99% of the way there to having a python script that updates my like terraform-docs with a cost table
Just have to figure out how to escape it properly
@refined-optician-52834 that’s awesome - add
and you’ll get what you want, those are color codes you’re seeing
oh snap
The readme badge feature is live 🙂
nice, I'll be hooking these up ASAP!