How to Install AWS CLI into your machine
This blog is for the total beginner or someone who just started to learn AWS and Linux and doesn't have prior knowledge working with AWS CLI Let me start with what is CLI<command line interface> A short brief: I will tell you what is AWS CLI and how to install it Trust me, it will be a game-changer for you to know why you use AWS CLI.
CLI is a text-based interface used to interact with our operating system (OS) by typing commands on the terminal. Users can interact with OS or software by writing commands onto the command prompt or terminal.
a user can use it for many things, such as resource efficiency, automation, scripting, etc. If you are familiar with commands, there are many examples of command-line interfaces such as Unix/Linux, windows command prompt, PowerShell, MacOS Terminal, etc.
The AWS CLI (Command Line Interface) is a sophisticated tool that allows users to connect with Amazon Web Services (AWS) via the command line. Here are several instances in which you may utilize the AWS CLI:
Automating Tasks
Managing Resources
Integration with Other Tools
Access Control and Security
Monitoring and Logging
Cost Management
Let's discuss the prerequisites needed before the installation of AWS CLI.
AWS Account and IAM credentials
IAM credentials are very easy to create; you can follow through AWS documentation, and many YouTube videos are there too.
Steps to Install AWS CLI into Your OS :
make sure you always install the latest version of aws cli for up-to-date packages. if you have aws cli v1 and want to install aws cli v2 then remove the older AWS CLI so that you can reinstall it with a newer version.
sudo yum remove awscli
...
Install AWS CLI on EC2 instances
You must have a nat<network access translation> or internet gateway for an internet connection.
for Linux OS users
Linux x86 (64-bit)
sudo curl "
https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
" -o "
awscliv2.zip
" unzip
awscliv2.zip
sudo ./aws/install
If your Linux distribution does not provide a built-in unzip command, you can use an equivalent or install it. The following command unzips the package and creates the aws directory in the current directory.
unzip
awscliv2.zip
if your Linux OS throws the error 'unzip' command not found, then install it through these commands
sudo apt install unzip
or check your Linux distro and use the command accordingly, AWS CLI might not get Installed if you do not have the unzip command installed, which means it will be there but not properly installed Check if it is installed or not by running these commands
aws configure
If it shows something like 'AWS access key ID [none]', it means it's there. you need to enter the IAM credentials [access key + secret key] combination of these two and regions. You can add or leave it as it is if you want.
You can install it on Windows instances and macos terminals as well I am not sharing those methods you can find it on AWS documentation
Install or update to the latest version of the AWS CLI - AWS Command Line Interface (amazon.com)