The AWS CLI tools are uniquely powerful in automating and managing AWS assets. As far as EC2 Instances go, the AWS CLI provides a number of capabilities to the administrator that the instance metadata alone can’t satisfy. (I will create a post in the future that will delve into a specific use case addressing this fact.) Speaking of blog posts, I wrote a post recently which covered how to overcome an issue attributed to the absence of required proxy information on a Linux host. In this post, I’ll explore an issue affecting AWS Windows machines which is proxy attributed as well.
An environment that I am supporting required use of the AWS CLI on their Linux and Windows machines for automating a particular task (will cover this in a future post.) On the Windows machines, we received the following error when launching the AWS executable:
PS C:\Users\Administrator\Desktop> aws ec2 describe-tags ('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not properly respond a fter a period of time, or established connection failed because connected host has failed to respond'))
Not an incredibly useful message by way of specifics, however the main theme here is that there appears to be some sort of network issue generating this 10060 error. I am aware that any number of things could constitute a result in this error being thrown, but after taking several moments to rule out the obvious (including perusing a few forums to no avail), I discovered the actual solution. In my specific case, I had to ensure that not only was the appropriate proxy information configured in IE, but more importantly I had to ensure that this information was also stored in the Windows client’s environment variables. For Powershell, this can be achieved like the following:
#Proxy Server Host and Port Variable Declaration
$PROXY = "http://10.232.17.199:8080"
#Setting Proxy Environment Variables
$env:HTTP_PROXY = $PROXY
$env:HTTPS_PROXY = $PROXY
If you use different proxy servers for each particular protocol, this would look different in your environment. Also, the final line tells Windows to bypass the proxy server when accessing the instance’s AWS metadata (this is locally retrievable). Hope this helps someone out there. =)