Terraform: Terrafrom not working behind a proxy using http(s)_proxy envvariable

Created on 8 Sep 2016  ยท  6Comments  ยท  Source: hashicorp/terraform

Hello,

Currently in terraform 0.7.3 in not working behind a proxy using openstack provider.

Steps to reproduce:

export http_proxy=127.0.0.1:3128
export https_proxy=127.0.0.1:3128

terraform plan

-> impossible to connect.

bug

Most helpful comment

@cblecker Hello I don't have other provider to test but i change the line 86 in

https://github.com/hashicorp/terraform/blob/master/builtin/providers/openstack/config.go

(old) transport := &http.Transport{ TLSClientConfig: config}

(new) transport := &http.Transport{Proxy: http.ProxyFromEnvironment, TLSClientConfig: config}

And now i can use proxy but i dont' know if it is the best place to set the proxy .

Jeff

All 6 comments

@jfpucheu Have you tried a different provider? Terraform appears to work correctly when using the Google Cloud provider, passing traffic through a proxy. I personally don't have an openstack environment to test using that provider. This may be a bug specific to that provider.

@cblecker Hello I don't have other provider to test but i change the line 86 in

https://github.com/hashicorp/terraform/blob/master/builtin/providers/openstack/config.go

(old) transport := &http.Transport{ TLSClientConfig: config}

(new) transport := &http.Transport{Proxy: http.ProxyFromEnvironment, TLSClientConfig: config}

And now i can use proxy but i dont' know if it is the best place to set the proxy .

Jeff

this helped me a lot! This fix muss be merged in the new version.

Closed by #8948

for Windows environment , set the proxy property like below in dos prompt or permanently in windows environment variable.

set HTTP_PROXY=http://1.2.3.4:8080
set HTTP_USER=abcd1234
set HTTP_PASSWORD=abcsd12312

then run terraform script, it should work.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings