Install AWS CLI there are many ways you can install AWS CLI, my favorite and also the easiest one is to run the following commands. It will install the awscli and other required components.

$ sudo apt update
$ sudo apt install awscli -y

If you face any issues while executing above, related to broken packages or dependency packages you can run the following in most cases if fixes the issues.

$ sudo apt install -f

After the installation is completed you can configure the access to AWS account using following commands. But before you start with configuring the access you need to have an IAM user’s Access key and Secret Key with proper access.

$ aws configure

Provide the Access Key and Secret Key for the user also specify the region you want to work with and the output format of the CLI commands.

If you want to configure the CLI for more than one IAM user/account you can make use of profile option with aws configure command, res if the process is same.

$ aws configure --profile dev-user

you have to use the profile option while making AWS CLI command requests as follows.

$ aws s3 ls --profile dev-user

AWS CLI stores all the configuration and credential information in your home directory inside .aws folder.

that’s it, this is all we need to do to setup AWS CLI. you can also checkout my other post where I have explained how we can assume AWS IAM Roles from CLI instead of using an IAM user.