Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Using http and https proxy in terraform

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

set HTTPS_PROXY=https://1.2.3.4:8080
set HTTPS_USER=abcd1234
set HTTPS_PASSWORD=abcsd12312

Then run terraform script, it should work.

For Linux/Mac environment , set the proxy property like below in dos prompt or permanently in Linux/Mac environment variable.

export HTTPS_PROXY="https://my-proxy"
export NO_PROXY="grafana.local,10.10.10.1,etc.com"

If you’re running the installer script in an automated manner, you can pass a http-proxy flag to set the address of the proxy. For example:

./install.sh http-proxy=http://internal.mycompany.com:8080

How to exclude Proxy such as Proxy Exclusions (NO_PROXY)

If certain hostnames should not use the proxy and the instance should connect directly to them (for instance, for S3), then you can pass an additional option to provide a list of domains:

./install.sh additional-no-proxy=s3.amazonaws.com,internal-vcs.mycompany.com,example.com
Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)