Install AWS CLI on WSL Ubuntu

Here are the steps I took to get AWS CLI installed on my WSL Ubuntu.

Before we install AWS CLI package itself, we need to get Python package manager pip installed first.

Download pip install script. Notice I use –k here, this is because I am running this behind company proxy, the proxy changes HTTPS certificate to its own certificate. Without –k the command will fail. You can leave it out if you have direct Internet access

$ curl -O -k https://bootstrap.pypa.io/get-pip.py  

Next, the usual update apt command

$ sudo apt-gt update  

Then we download and install Python minimal

$ sudo apt install python-minimal  

Now we can install pip, the –trusted-host here is again due to the fact that I am downloading all these packages behind proxy.

$ python get-pip.py --user --trusted-host=files.pythonhosted.org  

Next, verify that pip is installed correctly.

$ pip --version  

Finally, we can now use pip to install the AWS CLI.

$ pip install awscli --upgrade --user  

Verify the install by run aws –version.

image

AWS CLI from the WSL does have autocomplete provided natively. Otherwise there is a pretty cool autocomplete tool call aws-shell you can use to achieve that. GitHub link.

To install aws-shell, run the pip install command below

$ pip install aws-shell –-user  

Run aws-shell to get into the shell. The tool will not only prompt for parameters, but can also retrieve information from AWS and promote for completion, like existing stack name, Security Group Ids, etc.

image

Have fun!