<#C046GMHQ6NM|> Hello Team, I'm trying to run infr...
# help
g
#C046GMHQ6NM Hello Team, I'm trying to run infracost from Gitlab pipeline but getting Forbidden method POST url https://pricing.api.infracost.io/graphql , can I just run the tool with API key or do we need the Gitlab integration in order to run it from any CI source Thanks!
b
Hello! Gitlab integration (https://www.infracost.io/docs/integrations/gitlab_app/) is the easiest way to enable Infracost in your org. We recommend this path. If you don't want that, you can use our CI/CD example: https://gitlab.com/infracost/infracost-gitlab-ci You can always run
infracost
CLI tool manually. When registering with Infracost you get an API key. If you get Forbidden, I guess you should first check if the API key is set properly.
g
I have followed the Documents, using the Same API key i can run the API request using CURL to get data it works fine but the infracost cli doesn't just work
b
Can it be that your organization blocks our IPs?
Or do you use curl and cli from the same machine?
g
I suspect if the IP is blocked then the CURL wouldn't work either and I have, Yes I use the CURL and CLI as part of Same CI job
b
Could you please check one more thing? Run
infracost configure get api_key
and ensure the API key is set correctly?
You can also try running the command with the env var
INFRACOST_API_KEY=<key> infracost breakdown ...
g
I have tried as you suggested same error