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:
- Operating System: The AWS CLI supports various operating systems, including Linux, macOS, and Windows.
- Python: AWS CLI requires Python 3.6 or later. You can check your Python version using the command python3 --version or python --version.
- 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:
- Open Command Prompt: Launch the Command Prompt.
- Download Installer: Download the AWS CLI installer for Windows from the AWS CLI official website.
- Run Installer: Run the downloaded installer and follow the installation wizard’s prompts. Choose the installation location and other preferences.
- Verify Installation: To verify the installation, open a new Command Prompt and run:
aws --version
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:
- Open Terminal or Command Prompt: Open your terminal application (Linux/macOS) or Command Prompt (Windows).
- Configure AWS CLI: Run the following command:
aws configure
- 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.
- Choose Default Region: Enter your preferred AWS region. This is the region where your resources will be created by default.
-
Choose Output Format: You can select the default output format for command-line responses, such as
json
,text
, ortable
.
Testing
To ensure that your AWS CLI is configured correctly, try running a simple command to list your EC2 instances:
aws ec2 describe-instances
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)
up!