This message was deleted.
# general
b
This message was deleted.
👋 1
w
Hi @delightful-market-27721! Yep 🙂 You can use the CLI executable or Docker image directly, see this section. The Infracost setup GH Action just installs that, and sets this env var that you can set manually too. After that you can just run the CLI as documented in the GH Action examples.
infracost comment github --help
shows the other useful options, such as the github-api-url for your internal github.
d
Thanks @white-airport-8778 download curl -s -L https://infracost.io/downloads/v0.9/infracost-linux-amd64.tar.gz setup INFRACOST_API_KEY in secrets setup env INFRACOST_SKIP_UPDATE_CHECK
will above setup works ?
and use infracost commands
w
yep! Please ping us if you see any issues with posting comment to your on-prem GH instance - I wasn’t able to personally test posting comments as we don’t have access to a test env there but we’re happy to fix issues ASAP 🙂
d
Sure. Thanks @white-airport-8778
okay i am able to use binary and able to create Infracost JSON but comments part is failing with error command git hub actions used
Copy code
./infracost comment github --path /tmp/infracost.json --repo $GITHUB_REPOSITORY --github-token  --pull-request 3 --behavior new
error :
Copy code
Error: either --commit or --pull-request is required
Error: Process completed with exit code 1.
Am i missing somethings here? i am just following things from https://github.com/infracost/actions
w
hmm if you’re using an internal GH, you also need to pass this - can you try that in case the error is wrong?
Copy code
--github-api-url     GitHub API URL (default "<https://api.github.com>")
d
you mean instead of using
github
i need to use
github-api-url
after the comment
w
Sorry I meant this, as otherwise the comment will be sent to the public github.com API server by default:
Copy code
./infracost comment github --path /tmp/infracost.json --repo $GITHUB_REPOSITORY --github-token $ENV_FOR_TOKEN --pull-request 3 --behavior new --github-api-url <https://api.my-internalgithub.com>
d
ohh okay
w
any luck?
d
yeah it pass that state but looks like i need to the value i am using
secrets.GITHUB_TOKEN
don't have permission to generate the comments. I need to check with Infra team
w
Awesome! So adding
--github-api-url
resolved this error - correct?
Copy code
Error: either --commit or --pull-request is required
Error: Process completed with exit code 1.
d
yeah it is not giving me above error
🚀 1
Does infracost support AWS Cloudformation templates as well or any plan to support in future ?
m
Hey @delightful-market-27721, we have limited support for CloudFormation at the moment. We do plan full support for this in the future, however, this relies on rearchitecting some of our CLI internals to support a more flexible provider model. This is something we’re actively discussing internally at the moment. So hopefully we’ll have updates to share soon.
d
Thanks @mysterious-teacher-68276 👍
Is there any way i can configure git commit UI table with seperate row for each resource changes. for example, i am changing the instance type and ebs volume. But the UI table is showing the sum of both changes. I am able to see the seperate changes under
Infracost output
section. but it will be good if
monthly cost
table in comments can show seperate rows for each resources , along with total cost . i am using
--behavior update
in infracost comments. Let me know if that is possible. Btw thanks for making such a nice framework 🚀
i have couple of suggestion specially adding ML and provide recommendation values based on historical data
Another one is if infracost can be integrated with helm chart , as we are deploying applications in kubernets and user is setting cpu and memory based on random values, which is costing company. If infracost can be integrated with such user case , and give recommendation values to set cpu or memory . It will be big help.
m
Hey @delightful-market-27721, we don’t have an option within
infracost comment
to output a separate row for each resource change, unfortunately. You could manually achieve this yourself by saving the output of the
infracost breakdown
to a file using
--out-file
and then use a tool like
jq
to extract the resource costs/changes from the file and build a markdown table to post to the github API. We’re looking at making the
infracost comment
options a bit more flexible in the future so would be great to keep track of your requirements in an issue. Could I ask that you open a feature request here: https://github.com/infracost/infracost/issues so that we can prioritise accordingly.
regarding your suggestions - recommendations have long been a feature requested by users. However, we want to get it right and make sure the suggestions aren’t just noise. We’re hoping to have an early feature available this year.
kubernetes costs are also something we’re actively investigating
I’d recommend 👍 this issue https://github.com/infracost/infracost/issues/1541 to keep notified of developments
d
Great Thanks @mysterious-teacher-68276