As promised we are back with yet another blog describing one of the basic tools to communicate with the AWS service. Yes, you guessed right it is AWS CLI. It is the method to connect with AWS service locally and fetch your important data without going into the UI. Here, we will explain to you the setup of AWS CLI on different platforms i.e Mac, Windows, and Linux.
The AWS CLI is a unified tool to manage AWS services. With just one tool to download and configure, we can control multiple AWS services from the command line and automate them through scripts.
Let’s discuss the installation and setup of AWS CLI.
Installation Guide
β Windows
You can install version 1 of the AWS Command Line Interface (AWS CLI) on Windows by using a standalone installer (recommended) or pip, which is a package manager for Python.
π Install the AWS CLI version 1 using the MSI installer
Check the Releases page on GitHub to see when the latest version was released. When updates are released, you must repeat the installation process to get the latest version of the AWS CLI version 1.1
- Download the appropriate MSI installer:
- Run the downloaded MSI installer or the setup file.
- Follow the on-screen instructions. By default, the AWS CLI version 1 installs to C:\Program Files\Amazon\AWSCLI (64-bit version) or C:\Program Files (x86)\Amazon\AWSCLI (32-bit version).
- To confirm the installation, use the aws --version command at a command prompt (open the Start menu and search for cmd to start a command prompt).
1 2 3 4 | C:\> aws --version aws-cli/1.22.23 Python/3.8.8 Windows/10 botocore/1.13 |
If Windows is unable to find the program, you might need to close and reopen the command prompt to refresh the path and add the path manually.
π Install the AWS CLI version 1 using pip
- To Install the AWS CLI version 1, use the pip3 command (if you use Python version 3 or later) or the pip command. For the latest version of the AWS CLI, use the following command block:
1 2 3 | C:\> pip3 install awscli |
2. Verify that the AWS CLI version 1 is installed correctly.
1 2 3 4 | C:\> aws --version aws-cli/1.22.23 Python/3.8.8 Windows/10 botocore/1.13 |
β Linux/macOS
π Install the AWS CLI version 1 using pip
- Use the pip or pip3 command to install or update the AWS CLI. We recommend that if you use Python version 3 or later that you use the pip3 command.
- For the latest version of the AWS CLI, use the following command block:
1 2 3 | $ pip3 install awscli |
2. Verify that the AWS CLI is installed correctly.
1 2 3 4 | $ aws --version aws-cli/1.22.23 Python/3.8.8 Linux/4.14.133-113.105.amzn2.x86_64 botocore/1.13 |
Setup AWS CLI
This section explains how to quickly configure basic settings that the AWS Command Line Interface (AWS CLI) uses to interact with AWS. These include your security credentials, the default output format, and the default AWS Region.
The aws configure command is one of the ways to set up your AWS CLI installation. When you enter this command, the AWS CLI prompts you for four pieces of information:
- Access Key
- Secret Key
- Output
- Region
1 2 3 4 5 6 7 | $ aws configure AWS Access Key ID [None]: AKIAI***********LE AWS Secret Access Key [None]: wJa*****************************Y Default region name [None]: us-west-2 Default output format [None]: json |
Profiles
A collection of settings is called a profile. By default, the AWS CLI uses the default profile. You can create and use additional named profiles with varying credentials and settings by specifying the --profile option and assigning a name. This will help the settings to be specific to a certain user.
The following example creates a profile named userone.
1 2 3 4 5 6 7 | $ aws configure --profile userone AWS Access Key ID [None]: AKIAI****************PLE AWS Secret Access Key [None]: je7****************************EY Default region name [None]: us-east-1 Default output format [None]:json |
The following profiles will look something like the below in ~/.aws/credentials
1 2 3 4 5 6 7 8 9 10 11 12 13 | [default] AWS Access Key ID [None]: AKIAI***********LE AWS Secret Access Key [None]: wJa*****************************Y Default region name [None]: us-east-1 Default output format [None]: json [userone] AWS Access Key ID [None]: AKIAI****************PLE AWS Secret Access Key [None]: je7****************************EY Default region name [None]: us-east-1 Default output format [None]: json |
Congratulations!! you have successfully installed and set up AWS CLI on your specific platform (Mac, Windows, Linux). You would be able to communicate well with your AWS services and automate the process which will make it easier to interact.
I hope you enjoyed the article and if you found this useful, then please share it with your friends and colleagues. If this post helps you, spread this so that other people can also benefit.
If you have any queries please feel free to post them in the comments section or anything that you want to ask through mail contact.
Thank youπ
Also read,
- Difference between AWS, AZURE, and GCP Cloud
- Get Started with Terraform Script for AWS β with Examples
- AWS Cloud Practitioner Certification Essentials
- AWS Solutions Architect Certification Preparation β (SAA-C02)
You have observed very interesting points! ps decent web site. “To grow mature is to separate more distinctly, to connect more closely.” by Hugo Von Hofmannsthal.