How To Connect And Install AWS CLI On Mac And Windows?

In this AWS article, we will discuss how to install AWS CLI on Mac and Windows. We will walk you through each step involved in installing and connecting AWS CLI on Mac and Windows. We will also discuss a number of related topics, including:

  • What Is AWS CLI?
  • How to Install AWS CLI on Mac, Linux, and Unix?
  • How to Install AWS CLI on Windows?
  • How to Configure AWS CLI?
  • Frequently Asked Questions
  • Conclusion

Read on to find out what AWS CLI is, how it works, how to install AWS CLI on Linux, Mac, and Windows, and how AWS configure works.

What Is AWS CLI?

AWS Command Line Interface (CLI) is an interface used to manage the AWS services you use, by using a terminal session from your own client. This allows you to gain more control of your AWS services, configure them, and add a level of automation.

If you have been using Amazon Web Services for a long time now and find it easy to manage and work with all the services, then you may already know that there is so much more to the default browser console than meets the eye.

With AWS CLI, you can achieve that full potential to manage your AWS environment. It is your one-stop tool to control and manage all the AWS services from your own client, by using a terminal session.

Using AWS CLI means you would only be using one tool to download and configure your services. With AWS CLI, you can control and automate multiple AWS services by using scripts.

We will discuss in detail how you can use AWS CLI effectively and how you can install it on multiple operating systems. By the end of this article, you will also be able to configure AWS CLI.

How to Install AWS CLI on Mac, Linux, and Unix?

Depending on the operating system you have, you will have to download AWS CLI first, which is different for every operating system. For Linux, MacOS, and Unix, you should have the following prerequisites:

  1. At least Python 2 with version 2.6.5+ or Python 3 with version 3.3+ installed.
  2. To identify the current version of Python on your system, run the command below:
python --version

3. Once you know which version of Python you have on your PC and it meets the prerequisites, you can go ahead and install AWS CLI on your Mac, Linux, or Unix PC by following these steps.

See also  AWS Aurora Vs. Oracle: What To Choose and Why To Migrate

The recommended method to install AWS CLI on your PC is by using a bundled installer provided by Amazon Web Services. This installer will have all the things you need to install AWS CLI.

1. To begin the AWS CLI install, run the AWS CLI commands given below on your PC:

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

2. Next, unzip the download file on your PC:

unzip awscli-bundle.zip

3. Once you have unzipped the installation package, go ahead and run the installation below:

sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

The -b option will allow you to use AWS CLI on any directory. So you won’t have to enter any specifications for the install directory in your $PATH variable.

How to Install AWS CLI Windows

To install AWS CLI on Windows, you will need to meet the following prerequisites:

  • Your PC must have Microsoft XP, or a later version of Windows installed.
  • To begin the installation, there are three MSI installers that you can choose from. These include a 64-bit version for Windows, a 32-bit version for Windows, and a CLI setup file.

This setup file will automatically detect the version of Windows you have on your PC and install the appropriate version of AWS CLI.

  1. Click on the option to download the MSI installer.
  2. Next, run the download CLI setup file or MSI installer on your PC.
  3. Follow the on-screen instructions to complete the installation.

Once the CLI has been installed, the program files for it will be stored in the following locations, depending on your version of Windows:

  • In 32-bit version: C:\Program Files (x86)\Amazon\AWSCLI
  • In 64-bit version: C:\Program Files\Amazon\AWSCLI

Use the AWS version command in the command prompt to confirm the installation.

How to Configure AWS CLI?

Once you have installed AWS CLI on your computer, you will need to configure it before you can integrate it with your AWS services. To configure AWS CLI on your PC, enter this command prompt:

aws configure

The AWS CLI will ask for four types of data through AWS configure. The first two of these are mandatory to enter. These include your AWS secret access key and your AWS access key ID, which are basically your AWS account credentials.

If you don’t already have these pieces of information, you can generate new ones from the AWS Identity and Access Management (IAM).

The other two pieces of information include the region and the output format, which don’t need to be entered for the moment. You can leave them as default.

AWS Configure
AWS Access Key ID: AKIAI002JEXAMPLE
AWS Secret Access Key: tC3bxbDimVSDV/M/cOa3SRsEXAMPLEKEY
Default Region Name: us-east-2
Default Output Format: text
AWS Configure
AWS Configure

The default region name is where all of your requests will be directed to. You can view the Regions and Availability Zones to use these services and their respective codes.

See also  AWS DAX (Amazon DynamoDB Accelerator) Pros, Cons, Price

The default output format determines how the results will be formatted. You can use the following values in the output format:

  • text
  • table
  • json

The AWS access key ID and secret access key are what you use to authenticate your AWS account. By entering these credentials, you are authorized to carry out specific functions that lie within your permission level.

The access key ID consists of 20 random uppercase alphanumeric characters, such as shown in the example above, whereas the secret access key consists of 40 random lowercase and uppercase non-alphanumeric and alphanumeric characters as shown above.

These credentials can be generated for any IAM user who needs to authenticate a certain programmatic function, such as for AWS CLI login.

When these keys are generated, you will need to download and save these details somewhere safe. This information is only displayed once and if you lose access to it, you will need to delete the entire key ID and create a new key ID for the user account.

It is basically impossible to retrieve the lost secret access key ID because AWS does not store this information to ensure maximum security. When you associate AWS CLI with the access keys, all the API requests that are made to AWS are made safe with a digital signature.

To create new access keys for your AWS user account, you will have to use the IAM service. To learn more about this service and other information related to the user account and authentication, check our Amazon Web Services’ official documentation.

Now that you have installed and configured AWS CLI, the next step is to configure, manage, and script your AWS services to make them automated. Check out this page to learn all the commands related to AWS CLI.

FAQs: install AWS CLI On Mac And Windows

Q1. How To Pip Install AWS CLI On Linux?

To install AWS CLI and its packages on Linux computers, you can use the bundled installer or the pip package manager.

Q2: Where Is AWS Installed On Mac?

The CLI installer installs AWS CLI in /usr/local/aws on your Mac and creates a symlink AWS in the /usr/local/bin folder on your Mac.

Q4: How Do I Find My AWS CLI Access Key?

To get your AWS CLI access key, log into the AWS Management Console and launch the IAM console from console.aws.amazon.com/iam/.

Now go to Users in the navigation pane, select the user’s name, and then open the Security credentials tab. Finally, select the Create access key option and click on download to get your access key.

Q5: How to install AWS CLI v2?

Installation of AWS CLI V2 is the same as installing AWS CLI on any machine be it Windows or Mac.

Q6: AWS CLI install windows version 2

Installation of AWS CLI Version 2 is exactly the same as installing AWS CLI on any windows machine. Follow exactly the same set of steps.

Q7: AWS CLI download for windows

You can download AWS CLI for windows from here.

Q8: How do you check AWS CLI is installed or not?

You can verify that with this command:
Command : aws –version
Output : aws-cli/2.2.41 Python/3.8.8 Windows/10 exe/AMD64 prompt/off

Q9: Where is the AWS CLI config file?

Below are the default location of files for Linux and macOS: ~/.aws/config ~/.aws/credentials

For Windows: %USERPROFILE%\.aws\config , %USERPROFILE%\.aws\credentials

Q10: AWS CLI update

We do get regular updates on all the services from AWS, likewise, we have the AWS CLI V2 which is recommended by AWS.

You may also like to explore below AWS blogs.

Conclusion

In this article, we discussed how to install AWS CLI on Mac and Windows. We also learned how to configure AWS CLI and discussed related topics, such as-

  • What Is AWS CLI?
  • How to Install AWS CLI on Mac, Linux, and Unix?
  • How to Install AWS CLI on Windows?
  • How to Configure AWS CLI?

We hope you now understand how AWS CLI download works and how you can leverage it to control and automate your AWS services.

Happy Clouding!!

Leave a Comment