AWS (Amazon Web Services) is becoming a popular and growing trend in the Linux community. It is the perfect cloud infrastructure for any Linux user that wants to scale the productivity potential of their acquired Linux administration skills.
Whether you are looking for technological solutions related to Analytics & Data Lakes, Machine Learning, Serverless Computing, Storage, or Linux-centered products related to Analytics, Databases, Containers, and Front-End Web & Mobile, AWS has enough piece of the pie for all users.
Understanding the AWS CLI
The AWS CLI (Command Line Interface) makes it possible to access all the AWS services you might need in the comfort of your Linux command-line environment.
The AWS tool disregards the need for the browser-based AWS management console since it mimics the implementation of equivalent functionalities. Its features that can be accessed via the AWS CLI include AWS Management Console access functions and all Infrastructure as a Service (IaaS) AWS management & Administration functions.
AWS CLI makes it possible to not only have direct access to AWS services via the Linux terminal environment, but also public APIs. This tool also makes resources management possible through user-developed shell scripts.
Step 1: Installing Python PIP in Linux
Python PIP needs to be installed on your Linux system to provide the Python module associated with the installation of the AWS CLI. Installing the AWS CLI via a Python module ensures that your Linux system will continuously be up-to-date with the latest AWS CLI release every time you execute a system update command.
$ sudo apt install python3-pip [On Debian, Ubuntu and Mint] $ sudo yum install python3-pip [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a dev-python/pip [On Gentoo Linux] $ sudo pacman -S python-pip [On Arch Linux] $ sudo zypper install python3-pip [On OpenSUSE]
Check on the installed version of the Python package manager.
$ pip3 --version
Step 2: Installing AWS CLI in Linux
Our Linux systems are now ready for the AWS CLI installation via Python’s package manager by running the following command:
$ pip3 install awscli --upgrade --user
Do not run the above command as a sudoer/root user to be safe from future package conflicts during their installation or configuration.
Confirm the successful installation of AWS CLI.
$ python3 -m awscli --version
Step 3: Configuring AWS CLI in Linux
We need to configure some AWS CLI with your AWS credentials by running the awscli configure command.
$ python3 -m awscli configure
You will be asked for AWS Access Key ID, AWS Secret Access Key, Default region name, and Default output format.
For AWS Access Key ID and Secret Access, Log into AWS from the Web Interface and navigate to the Security credentials section on the account username drop menu.
You should be redirected to the Access Keys region. Click on Create New Access Key if you do not have one.
You will be met with the following prompt. Here, you can download and save the Key File.
To view them, click on Show Access Key.
You can now use these keys to finalize AWS CLI configuration.
$ python3 -m awscli configure
The files ~/.aws/credentials and ~/.aws/config store the AWS CLI program’s configurations.
$ ls -l ~/.aws/config $ ls -l ~/.aws/credentials
To start interacting with your AWS CLI, use the command:
$ pythom3 -m awscli s3 ls
For more help with using AWS CLI, run:
$ python3 -m awscli help
Your AWS CLI journey on Linux is now ready to begin. Hope you enjoyed the article.