Terraform: Configuration of remote state ignores HTTP proxy

Created on 17 Oct 2016  ยท  7Comments  ยท  Source: hashicorp/terraform

Terraform Version

$ terraform -v
Terraform v0.7.6

Affected Resource(s)

N/A

Terraform Configuration Files

N/A

Debug Output

https://gist.github.com/jwadolowski/cd966c01b060f00c3fd69e5421484635

Expected Behavior

Terraform should respect http_proxy and https_proxy environment variables (as mentioned here)

Actual Behavior

$ env | grep http_
http_proxy=http://localhost:8118

Despite of above, I can't see any HTTP request coming through my proxy server. At the same time curl and other HTTP clients respecting http_proxy variable work fine.

Steps to Reproduce

  1. Configure http_proxy variable to point at actual proxy server
  2. Try to move local state to remote one via terraform remote config command (details in attached gist)

    Important Factoids

All outgoing HTTP traffic needs to go through defined proxy.

References

  • GH-523
backenartifactory bug v0.7

Most helpful comment

It looks like the current version is still using an empty http.Transport.

Regardless of whether this gets fixed or not (I opened a new issue upstream), we can probably just inject our own Transport into the config.

All 7 comments

Hi,

Thanks for reporting this issue. This looks like a bug in the artifactory client that terraform uses. We'll see if we can get this fixed upstream.

@jbardin Any update on having this resolved upstream?

It looks like the current version is still using an empty http.Transport.

Regardless of whether this gets fixed or not (I opened a new issue upstream), we can probably just inject our own Transport into the config.

This is a pretty big blocker for us expanding our use of Terraform at my company. It means we're having to get off the network to run Terraform so we can just shut off our proxy settings entirely and that's not a long-term acceptable solution to some folks in our org. Any idea of priority on this or an ETA?

Unfortunately at this time the Terraform team at HashiCorp isn't able to work on this due to other tasks, and due to the fact that we don't have an artifactory setup handy to test such a change with.

However, if someone else who _does_ already have an artifactory account and has the time and willingness to work on this, we'd love to review a Pull Request. It looks like the work here would be to pass in an explicit transport where the artifactory client is instantiated and configure that http.Transport object use http.ProxyFromEnvironment as its proxy function.

The linked PR should have closed this issue, so I am going to do so now. Thanks!

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