DEV Community

Cover image for Step-by-Step Tutorial: Install and Configure AWS CLI in Under 10 Minutes
Hardik Sheth
Hardik Sheth

Posted on

Step-by-Step Tutorial: Install and Configure AWS CLI in Under 10 Minutes

The Amazon Web Services Command Line Interface (AWS CLI) is a powerful tool that allows users to interact with various AWS services and resources through the command line. It streamlines tasks, automates operations, and enables developers, administrators, and DevOps engineers to manage AWS environments efficiently. In this tutorial, I’ll guide you through the process of installing and configuring the AWS CLI in under 10 minutes, so you can start leveraging its capabilities right away.

You can go with my video tutorial ☝️ to see the complete step by step guide or you can continue this article 👇 and get high level overview.

Prerequisites

Before we begin, ensure you have the following prerequisites:

  1. Operating System: The AWS CLI supports various operating systems, including Linux, macOS, and Windows.
  2. Python: AWS CLI requires Python 3.6 or later. You can check your Python version using the command python3 --version or python --version.
  3. AWS Account: You’ll need an AWS account to use the AWS CLI. If you don’t have one, you can sign up for a free AWS account on the AWS website.

TL;DR

📥 Download and install AWS CLI from the official website.
🔑 Create a dedicated user for AWS CLI in AWS IAM.
⚙️ Configure AWS CLI with your AWS account credentials.
🖥️ Verify successful installation and configuration by running AWS CLI commands.

Installation

Follow these steps to install the AWS CLI:

  1. Open Command Prompt: Launch the Command Prompt.
  2. Download Installer: Download the AWS CLI installer for Windows from the AWS CLI official website.
  3. Run Installer: Run the downloaded installer and follow the installation wizard’s prompts. Choose the installation location and other preferences.
  4. Verify Installation: To verify the installation, open a new Command Prompt and run:
aws --version
Enter fullscreen mode Exit fullscreen mode

You should see the version number of the installed AWS CLI.

Configuration

Once the AWS CLI is installed, you need to configure it with your AWS credentials to interact with your AWS resources securely. Follow these steps:

  1. Open Terminal or Command Prompt: Open your terminal application (Linux/macOS) or Command Prompt (Windows).
  2. Configure AWS CLI: Run the following command:
aws configure
Enter fullscreen mode Exit fullscreen mode
  1. Provide Access Key and Secret Key: Enter your AWS Access Key ID and AWS Secret Access Key. These can be obtained from your AWS account’s Security Credentials section.
  2. Choose Default Region: Enter your preferred AWS region. This is the region where your resources will be created by default.
  3. Choose Output Format: You can select the default output format for command-line responses, such as json, text, or table.

Testing

To ensure that your AWS CLI is configured correctly, try running a simple command to list your EC2 instances:

aws ec2 describe-instances
Enter fullscreen mode Exit fullscreen mode

If you see a list of your EC2 instances, congratulations! You’ve successfully installed and configured the AWS CLI.

Conclusion

In this article, you learned how to quickly install and configure the AWS CLI, enabling you to manage your AWS resources efficiently from the command line. The AWS CLI is a versatile tool that empowers users to automate tasks, streamline workflows, and harness the power of AWS services seamlessly. With your AWS CLI up and running, you’re well-equipped to embark on your cloud journey with AWS.

Subscribe to my YouTube channel to learn more about devops — https://www.youtube.com/@hardiksheth1717

Top comments (1)

Collapse
 
shadowruge profile image
izaias

up!