Open schosterbarak opened 4 years ago
Hi Barak!
You can do this by running terraform plan
on GH action and then sending tfplan file to cost.modules.tf
with or without preprocessing via terraform.jq
, as described here - https://github.com/antonbabenko/terraform-cost-estimation#example---get-cost-estimates-during-terraform-plan
You can also make your pipeline fail if price is too high:
$ ... | curl -s -X POST -H "Content-Type: application/json" -d @- https://cost.modules.tf/ > costs.json
$ jq 'if .monthly|tonumber > 10 then "$" else "$$$" end' costs.json
Great tool. would love to continuously acknowledge the estimated price of https://github.com/bridgecrewio/terragoat on every push to master