vscode-infracost
vscode-infracost copied to clipboard
Error infracost register behind proxy
Hello
Context
I'm in a company that filters the internet flow behind a web proxy
When I want to make the following order
infracost register
I have an error
Error: Error sending API request: Post "https://dashboard.api.infracost.io/apiKeys?source=cli-register": dial tcp 3.139.172.42:443: i/o timeout
Request
Can you add a functionality to allow to configure the module with a web proxy ?
Sincerely
Hi @olahouze. Have you set a https_proxy
environment variable in your terminal to point to your company's HTTPS proxy server? I think this should work
To unblock you just now though, you can sign up directly at https://dashboard.infracost.io/ and retrieve an API key from your "Org Settings".
Hi @alikhajeh1 I set up all required env variables to use proxy but getting the error below
main└─ $ infracost breakdown --path .
Evaluating Terraform directory at .
✔ Downloading Terraform modules
✔ Evaluating Terraform directory
✖ Retrieving cloud prices to calculate costs
Error: Invalid API response: 401 authenticationrequired
We have been notified of this issue.
Hi @olahouze. Have you set a
https_proxy
environment variable in your terminal to point to your company's HTTPS proxy server? I think this should work
Hello
I don't have the rights on my company's computer to modify the environment variables. Here is the reason of my request: to be able to pass the proxy parameters directly in the command line of the tool (for that I have the rights)
To unblock you just now though, you can sign up directly at https://dashboard.infracost.io/ and retrieve an API key from your "Org Settings".
Good news but same problem : after put API KEY, communication KO because no proxy parameter
Sincerely
Hi @alikhajeh1 I set up all required env variables to use proxy but getting the error below
@SerhiiSokolov this looks like it's still hitting the proxy. Do you have the exact commands you ran to set the proxy variables?
Good news but same problem : after put API KEY, communication KO because no proxy parameter
@olahouze out of interest does it work if you add the env var inline and run the infracost
cli manually, e.g:
https_proxy=https://<PROXY> infracost breakdown ...
Another option we might have is to include it in the Infracost config file once we add support for that to VS Code.
@olahouze we just released a new version of the Infracost VS Code Extension (v0.2.11) that supports using a config file. The config file also supports env
variables being defined, so I was wondering if you could possibly test that?