How to install AWS command line interface (awscli) on Linux?

Install awscli

Yeah, this should help you to manage many things from your Linux server or local machine.

AWS supports command line interface tool. It’s package name is awscli. The package awscli is available in commonly using package manager like YUM, APT, APT-GET etc..

This is not recommended to install using YUM or APT. The default package managers may not have the latest version. This is the reason.

We can simply install awscli using pip. Pip is a package management system used to install and manage software packages written in Python.

How to check pip installed or not?

pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

Install pip – if it’s not there.

pip installation steps

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

The script downloads and installs the latest version of pip.

python get-pip.py --user

Next step is important. We need to add the local bin location to current PATH variable.

To list current PATH details:

echo $PATH

Add the executable path to your PATH variable: ~/.local/bin

export PATH=~/.local/bin:$PATH

This command adds a path, ~/.local/bin in this example, to the current PATH variable.

Load the profile into your current session.

source ~/.profile

You can find the shell’s profile script in your user folder.

Installing the AWS CLI with Pip

pip install awscli --upgrade --user

You can use the above command to upgrade awscli tool.

Verify that the AWS CLI installed correctly:

$ aws --version
aws-cli/1.14.37 Python/2.7.6 Linux/4.4.0-111-generic botocore/1.8.41

Add the executable path to your PATH variable: ~/.local/bin

export PATH=~/.local/bin:$PATH

This command adds a path, ~/.local/bin in this example, to the current PATH variable.

Load the profile into your current session.

source ~/.profile

To see more details about aws commandline interface tool:

  aws help
  aws command help
  aws command subcommand help

 

How to give access only to a folder inside s3 bucket for an AWS IAM user?

Sometime, you want this option to limit access to an s3 buckets from a particular IAM user. This can be done by adding custom policy on IAM user without changing any policies from bucket level.

Scenario: You are AWS account owner and you want to give access to one of your web developer to a particular folder on your main s3 bucket. It’s safe to give access in this manner.

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

4 thoughts on “How to install AWS command line interface (awscli) on Linux?

Leave a Reply

Your email address will not be published. Required fields are marked *