infobloxopen / terraform-provider-infoblox

Infoblox NIOS Terraform Provider
https://github.com/infobloxopen/terraform-provider-infoblox
Mozilla Public License 2.0
66 stars 76 forks source link

Need mechanism to use http proxy #121

Open alexjfisher opened 3 years ago

alexjfisher commented 3 years ago

At the moment, it isn't possible to configure the provider to use an http proxy to communicate with the infoblox server.

I've submitted https://github.com/infobloxopen/infoblox-go-client/pull/131 that would enable the use of HTTP(S)_PROXY environment variables. If that change is accepted (and released), I'll create a PR here to bump the dependency on that module.

It seemed a much simpler approach that adding extra explicit configuration options to the terraform provider and that would also require the latest infoblox-go-client. (I've just noticed that the client library didn't have any proxy support until 2 weeks ago. https://github.com/infobloxopen/infoblox-go-client/pull/102)

sgabenov commented 3 years ago

I have a problem, that i could not authenticate with TF provider through proxy, get this kind of error:

╷
│ Error: WAPI request error: 401('401 ERROR')
│ Contents:
│ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
│ <HTML><HEAD>
│ <TITLE>401 Authorization Required</TITLE>
│ </HEAD><BODY>
│ <H1>Authorization Required</H1>
│ This server could not verify that you
│ are authorized to access the document
│ requested.  Either you supplied the wrong
│ credentials (e.g., bad password), or your
│ browser doesn't understand how to supply
│ the credentials required.<P>
│ <HR>
│ </BODY></HTML>
│ 
│ 
│   with module.infoblox-front.provider["registry.terraform.io/infobloxopen/infoblox"],
│   on .terraform/modules/infoblox-front/main.tf line 3, in provider "infoblox":
│    3: provider "infoblox" {

The API is working when configuring auth like this:

curl -u user:password -X POST --header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
-d 'ip=10.147.138.4&name=testme1.dev.nibr.novartis.net&with_ptr=true&issuer=shiryin2' \
'https://infoblox.prd.nibr.novartis.net/v1/a.json'

How this can be configured to use with TF Infoblox Provider?