Skip to content

Setting up AWS CLI

A guide to Setting up AWS CLI and configuring it for your AWS account.

Prerequisites

  • An AWS account. If you don't have one, you can create it here.

MAC Installation

  1. Open your terminal.
  2. Run the following command to install AWS CLI using Homebrew:
    brew install awscli
    
  3. Verify the installation by checking the version:
    aws --version
    

Get AWS Credentials

  1. Sign in to the AWS Management Console.
  2. Navigate to the IAM (Identity and Access Management) service.
  3. In the left sidebar, click on "Users."
  4. Click on your username.
  5. Go to the "Security credentials" tab.
  6. Click on "Create access key."
  7. Your Access Key ID and Secret Access Key will be displayed. Copy and save them securely.

Configure AWS CLI

  1. Open your terminal.
  2. Run the following command to configure AWS CLI:
    aws configure
    
  3. You will be prompted to enter the following details:
  4. AWS Access Key ID: Enter the Access Key ID you obtained earlier.
    • AWS Secret Access Key: Enter the Secret Access Key you obtained earlier.
    • Default region name: Enter your preferred AWS region (e.g., us-east-1).
    • Default output format: You can choose json, text, or table. For beginners, json is recommended.
  5. To verify that AWS CLI is configured correctly, run the following command to list your S3 buckets:
    aws s3 ls
    
    If everything is set up correctly, you should see a list of your S3 buckets (if any).