AWS CentOS

CentOS Install AWS CLI

Amazon is one of the most popular service providers as far as cloud platforms. Using the service, any business can share computing power, content delivery, database storage and a number of additional functionalities. Thus, Amazon offers the best service for businesses to scale and grow.The most business-friendly offer that comes up with the AWS is the pricing. Instead of charging a ton at the starting of each month/year, Amazon treats them as utilities. You pay just as much as you use them and as long as you use them.

With the adjustable price, AWS offers the best platform for almost any use case – data warehousing, directories to content delivery, deployment tools and much more!

Another important factor of the cloud platform is the security. With AWS, the security is on the strongest level. Broad security certification and accreditation, strong data encryption at rest and in-transit, hardware security modules and strong physical security – every single features guarantee a perfect solution for the IT infrastructure.

Now, for enjoying the feature of the AWS, there’s already a powerful console tool available, known as the AWS CLI. It puts all the controls of multiple AWS services within a single tool. As the name suggests, it’s a console tool.

As of enterprise Linux, CentOS/RHELE is the best choice as it comes up with a large community and professional support. Today, let’s check out setting up the AWS CLI tool on CentOS/RHEL.

Setting up the system

For installing AWS CLI, we need to set up the “pip” first. PIP is essentially the package manager for Python. Using the tool, it’s possible to download and install various Python tools directly on your system.

PIP is available on the EPEL repository, not the default one. Make sure that your system supports the EPEL repo.

sudo yum install epel-release

Make sure that the “yum” database cache up-to-date –

sudo yum update

Now, it’s time to install “pip”!

sudo yum install python-pip

Note – The best way of enjoying the software is using Python 3. Python 2.7 is going to become obsolete at one point and Python 3 is going to prevail for sure. Learn how to set up Python 3 on CentOS.

For Python3, you need the “pip3”. It’s specifically for Python 3 platform. Install “pip3” with the following command –

sudo yum install python34-pip

Installing AWS CLI

  • Using “pip” direclty

Update the “pip” or “pip3” first.

sudo pip install --upgrade pip

# OR

sudo pip3 install --upgrade pip

Once the PIP tool is installed, we can install the AWS CLI tool. Just run the following command –

pip3 install awscli --upgrade --user

In the above command, we force the “pip3” to install “awscli”, “upgrade” any outdated component necessary and install the tool in the user’s subdirectories (avoiding file conflicts of the system library).

  • Using the “bundle” installer

This method also uses the “pip” or “pip3” tool from Python, so everything should work just fine as before.

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

Extract the downloaded file –

unzip awscli-bundle.zip

Now, run the install executable –

sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

If your user account doesn’t have the permission for performing “sudo” commands, then you should follow the following steps.

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -b ~/bin/aws

Now, it’s time to make sure that the environment variables are perfectly set to be able to find out the AWS CLI.

echo $PATH | grep ~/bin

As you can see, “~/bin” is in the PATH environment variable. If not, consider running the following command –

export PATH=~/bin:$PATH

Verifying the installation

Now, the installation is complete. However, we always should make sure that whatever you’ve installed is working properly.

Run the following command –

aws --version

Voila! AWS CLI is installed correctly!

Uninstalling AWS CLI

Depending on your installation process, you can easily uninstall the tool from your system.

  • “pip” or “pip3”

    Run the following command –

    pip uninstall awscli
  • Bundle installer

    Run the following commands –

    sudo rm -rf /usr/local/aws
    sudo rm /usr/local/bin/aws

Enjoy!

About the author

Sidratul Muntaha

Sidratul Muntaha

Student of CSE. I love Linux and playing with tech and gadgets. I use both Ubuntu and Linux Mint.