The AWS CLI wouldn’t connect. Timeouts. Frustration. The network was locked down behind a proxy that didn’t care about your deadlines.
When AWS CLI access must route through an HTTP or HTTPS proxy, the smallest misstep in configuration can block everything. Understanding exactly how to set HTTP_PROXY, HTTPS_PROXY, and NO_PROXY is the difference between a working deployment and staring at a blinking cursor.
The AWS CLI supports proxy settings at the environment level. Set them directly in your shell before running commands:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1,.internal-domain.com
On Windows PowerShell:
setx HTTP_PROXY "http://proxy.example.com:8080"
setx HTTPS_PROXY "http://proxy.example.com:8080"
setx NO_PROXY "localhost,127.0.0.1,.internal-domain.com"
Some AWS CLI commands, especially those using the AWS SDK under the hood, will fail silently if proxy variables are wrong or omitted. Double-check your proxy server’s protocol — mixing http with https will cause connection resets. Always match the proxy URL scheme with what your proxy server supports.
When working within private networks, a corporate proxy often filters outbound traffic. If your AWS CLI calls hang or error with Connection timed out after X milliseconds, test proxy connectivity directly: