This project is made in the context of flexyfriday with @SoyTecnopata in order to evaluate Infracost tool with Github Actions.
Once your infracost workflow is configured, when doing PR, you can get a nice comment like below
Also, you can use locally in pre-commit and add infracost hook, with costs checks, and for example with this configuration:
- id: infracost_breakdown
args:
- --args=--path=./terraform
- --args=--terraform-var-file="terraform.tfvars"
- --hook-config='.projects[].diff.totalMonthlyCost|tonumber < 2'
- --hook-config='.currency == "USD"'
verbose: true # Always show costs
will Fail