This guide walks you through the complete process of installing and configuring the AWS Command Line Interface (CLI) on your computer. This is the first step needed to manage your AWS services from your terminal.
Step 1: Prerequisites 🧠
This guide assumes a basic understanding of AWS IAM (user permissions). We will be creating a user and an access key.
Step 2: Install the AWS CLI 💻
You need the official AWS Command Line Interface (CLI) to control your AWS account from your terminal (like Command Prompt or PowerShell).
➡️ Official AWS CLI Installation Guide
Step 3: Configure Your AWS CLI 🔑
Next, connect the CLI tool to your AWS account using an Access Key.
Create Your Access Keys:
- Log in to your AWS Management Console.
- In the top search bar, type "IAM" and go to the IAM service.
- Click on Users in the left-hand menu.
- You can either:
- Create a new user: Click "Create user," give it a name (like
s3-backup-user), and on the next page, attach the AmazonS3FullAccess policy. This gives the user permission to manage S3.
- Use an existing user: Click on your username. Ensure they have S3 permissions (check the "Permissions" tab).
- Click on the user's name, then go to the Security credentials tab.
- Scroll down to "Access keys" and click Create access key.
- Choose "Command Line Interface (CLI)" as the use case and confirm.
- Important 🚨: AWS will show an Access Key ID and a Secret Access Key. Copy both and save them in a secure location (like a password manager). The secret key will not be shown again after this window is closed.
Run the Configure Command:
Open your terminal (Command Prompt, PowerShell, or Terminal on Mac) and type this command:
The prompt will ask for four inputs. Paste the keys you saved:
- AWS Access Key ID: [Paste the key you just saved]
- AWS Secret Access Key: [Paste the secret key you just saved]
- Default region name: [Enter your closest region, e.g.,
us-east-1 or ap-southeast-1]
- Default output format: [You can press Enter, or type
json]
Your CLI is now linked to your account. 🥳