1. Home
  2. Technical
  3. AWS CLI installation

AWS CLI installation

Official documentation on how to install the AWS CLI:  https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Since the~/bin directory exists in the PATH variable, it is a good idea to put the “aws” binary in that directory.
With the “-i” key, we also specify the directory where everything else needed to run the application will be installed.

mkdir -p ~/bin
cd ~/tmp
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
aws/install -b ${HOME}/bin -i ${HOME}/aws
rm -rf ~/tmp/aws

In order to associate this newly installed utility with a specific AWS account, you should run the command:

aws configure

It prompts 4 questions:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region name (can be left with default value “None”)
  • Default output format (can be left with default value “None”)

The entered values are stored in ~/.aws/credentials and ~/.aws/config files and can be manually updated/changed later.

Here you can find more detailed information about configuration:

https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html

There is a variety of ways to verify if the integration is working and if the AWS CLI utility is correctly configured and able to log in, but one of them is, e.g. , the command:

aws iam list-users

Assuming some users are created on the AWS side, the output will look similar to:

{
    "Users": [
        {
            "Path": "/",
            "UserName": "Pendejo",
            "UserId": "AIDAXYW3T53I7TKJQKCXY",
            "Arn": "arn:aws:iam::534110269137:user/Pendejo",
            "CreateDate": "2022-02-22T14:15:18+00:00"
        },
        {
            "Path": "/",
            "UserName": "Troll",
            "UserId": "AIDAXYW3T53ITVDUJT4DX",
            "Arn": "arn:aws:iam::534110269137:user/Troll",
            "CreateDate": "2022-02-22T14:15:18+00:00"
        }
    ]
}

 

For more detailed instructions you can refer to the official documentation:
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-using.html

Updated on 21. Sep 2022

Was this article helpful?

Related Articles