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

Error infracost register behind proxy #22

Open
olahouze opened this issue Jul 8, 2022 · 6 comments
Open

Error infracost register behind proxy #22

olahouze opened this issue Jul 8, 2022 · 6 comments

Comments

@olahouze
Copy link

olahouze commented Jul 8, 2022

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

@aliscott
Copy link
Member

aliscott commented Jul 8, 2022

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".

@alikhajeh1 alikhajeh1 assigned alikhajeh1 and unassigned alikhajeh1 Jul 8, 2022
@SerhiiSokolov
Copy link

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.

@olahouze
Copy link
Author

olahouze commented Sep 5, 2022

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

@aliscott
Copy link
Member

aliscott commented Sep 5, 2022

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?

@aliscott
Copy link
Member

aliscott commented Sep 5, 2022

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.

@alikhajeh1
Copy link
Member

@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?

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

4 participants