Closed alexjfisher closed 3 years ago
@alexjfisher ,
Thanks for suggesting this feature. We will add support to configure provider proxy in the next official version of the provider. About the second issue, if we deprecate useProxy arguments from api call function it will break customers scripts logic and we prefer not to do that.
Regards, Roy
Hi @alexjfisher The new provider's version is now available and it includes your feature, you may use it now.
Thank you, Alon
It'd be nice if we could configure the provider to use a proxy (or if it automatically picked up defacto standard
HTTP_PROXY
style environment variables).I've taken a quick look, and at first, this looked really simple. Just add a couple more provider parameters and use them here. https://github.com/CheckPointSW/terraform-provider-checkpoint/blob/b8f74ca946aff0e65fb78339a7d8f7728ba5b8d2/checkpoint/provider.go#L243
Unfortunately, it appears the go sdk also wants every call to
ApiCall
to specifyuseProxy
https://github.com/CheckPointSW/cp-mgmt-api-go-sdk/blob/472d2ea2bffe47c2a6507bcf6accb0156aaf2211/APIFiles/APIClient.go#L222 ??!Should I create a PR here, or perhaps better would be a PR in the SDK to deprecate
useProxy
altogether?? (I don't understand the use case of using a proxy for some api calls, but not others).Change
if useProxy
here https://github.com/CheckPointSW/cp-mgmt-api-go-sdk/blob/472d2ea2bffe47c2a6507bcf6accb0156aaf2211/APIFiles/APIClient.go#L265 toif c.proxyHost != ""
like is done here https://github.com/CheckPointSW/cp-mgmt-api-go-sdk/blob/472d2ea2bffe47c2a6507bcf6accb0156aaf2211/APIFiles/APIClient.go#L625.Thanks