Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I integrate it with a GitHub action? #13

Open
schosterbarak opened this issue Jun 8, 2020 · 1 comment
Open

How can I integrate it with a GitHub action? #13

schosterbarak opened this issue Jun 8, 2020 · 1 comment

Comments

@schosterbarak
Copy link

schosterbarak commented Jun 8, 2020

Great tool. would love to continuously acknowledge the estimated price of https://github.com/bridgecrewio/terragoat on every push to master

@antonbabenko
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants