Created
July 11, 2019 01:27
-
-
Save awgreene/9cb7454d7bea3e66a6e91814783094fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A custom HTTPClient is used here since the default HTTPClients ProxyFromEnvironment | |
// uses a cache which won't let us update the proxy env vars | |
sess, err := session.NewSession(&aws.Config{ | |
Credentials: credentials.NewStaticCredentials(cfg.AccessKey, cfg.SecretKey, ""), | |
Region: &d.Config.Region, | |
Endpoint: &d.Config.RegionEndpoint, | |
HTTPClient: &http.Client{ | |
Transport: &http.Transport{ | |
Proxy: func(req *http.Request) (*url.URL, error) { | |
return httpproxy.FromEnvironment().ProxyFunc()(req.URL) | |
}, | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment