How to install AWS CLI
Hello Everyone
Welcome to CloudAffaire and this is Debjeet.
In the last blog series, we have discussed AWS Elastic Beanstalk service.
https://cloudaffaire.com/category/aws/elastic_beanstalk/
In this blog post, we will not start with a new service, instead will discuss AWS CLI.
What is AWS CLI?
AWS Command Line Interface (AWS CLI) is an open-source tool that enables you to interact with AWS services using commands in your command-line shell. With minimal configuration, you can start using functionality equivalent to AWS Management Console from the command prompt in your favorite terminal program. AWS CLI supports all the major operating systems and using AWS CLI you can administer all the IaaS (infrastructure as a service) services provided by AWS.
Next, we are going to install AWS CLI on windows OS. We have also given the installation procedure for other OS’s.
AWS CLI Installation:
OS: Linux
Step 1: Install Python and PIP if not already installed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
## Check if Python is already installed. python --version ## Install Python ## On Debian derivatives such as Ubuntu, use apt. sudo apt-get install python3 ## On Red Hat and derivatives, use yum. sudo yum install python3 ## On SUSE and derivatives, use zypper. sudo zypper install python3 ## Install PIP ## On all linux OS flavours curl -O https://bootstrap.pypa.io/get-pip.py python3 get-pip.py --user ## Check PIP version pip3 --version |
Step 2: Install AWS CLI.
1 2 3 4 5 |
## Install AWS CLI using PIP pip3 install awscli --upgrade --user ## Verify that the AWS CLI installed correctly. aws --version |
OS: MAC
Step 1: Install Python and PIP if not already installed.
1 2 3 4 5 6 7 8 |
## Install python and PIP using homebrew xcode-select --install /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install python3 #also installs PIP ## Check python and pip versions python --version pip3 --version |
Step 2: Install AWS CLI.
1 2 3 4 5 |
## Install AWS CLI using PIP pip3 install awscli --upgrade --user ## Verify that the AWS CLI installed correctly. aws --version |
OS: Windows
Step 1: Open PowerShell using admin and install Chocolatey.
1 2 3 4 |
## Install chocolatey ## open powershell using admin privilage and execute below command to install chocolatey Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) exit |
Step 2: Install AWS CLI.
1 2 3 4 5 6 7 8 9 10 11 12 |
## Open command prompt using admin privilage ## Check if installation was successfull choco --version ## Install aws cli choco install awscli ## Refresh the environment and check if aws cli installed successfully. refreshenv ## Check if AWS CLI successfully installed aws --version exit |
AWS CLI successfully installed on windows OS.
Hope you have enjoyed this article. In the next blog post, we will discuss how to configure AWS CLI.
To get more details on AWS CLI, please refer below AWS documentation
https://docs.aws.amazon.com/cli/index.html