AWS CLI Installation and Configuration

Aasifa ShaikAasifa Shaik
2 min read

The AWS CLI is needed to interact with AWS services from your terminal. Here’s how to install it:

Download AWS CLI:

  1. Visit the Install or update to the latest version of the AWS CLI - AWS Command Line Interface (amazon.com)

  2. Download the Windows installer (.msi file) as shown below.

    1. Run the installer and follow the on-screen instructions.

    2. After installation, open a new Command Prompt and type aws --version to check if AWS CLI is installed.

Installing in Linux environment

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Configure AWS CLI

  1. Run aws configure in the Command Prompt.

  2. Enter your AWS credentials (Access Key ID and Secret Access Key), along with the default region (e.g., us-east-1).

     aws configure
     AWS Access Key ID [None]: YOUR_ACCESS_KEY
     AWS Secret Access Key [None]: YOUR_SECRET_KEY
     Default region name [None]: us-east-1
     Default output format [None]: json
    

    For Access key and secret key ,

  3. Navigate to the IAM (Identity and Access Management) Dashboard.

  4. Create a New IAM User (if needed).

  5. Attach Permissions.

In the next step, you will need to attach permissions to the new user. Choose one of the following options:

  • Select Attach policies directly and choose AmazonS3FullAccess (for S3 access) and any other required policies.

  • Alternatively, select AdministratorAccess if you want the user to have full AWS account permissions.

  1. Get the Access Key and Secret Key under security credentials.

  2. Important: Save these keys! You will only be shown the Secret Access Key once, so copy and store them in a secure place.

    You can also download the credentials as a .csv file by clicking the Download .csv button.

  3. Enter the following details when prompted:

    • AWS Access Key ID: Your Access Key ID from the IAM Dashboard.

    • AWS Secret Access Key: Your Secret Access Key from the IAM Dashboard.

    • Default region name: e.g., us-east-1 (or whichever region you prefer).

    • Default output format: You can choose json, text, or table (default is json).

      AWS Configuration is done. 💁‍♀️

0
Subscribe to my newsletter

Read articles from Aasifa Shaik directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aasifa Shaik
Aasifa Shaik

I am a DevSecOps Engineer at Renesas, where I specialize in integrating security practices within the DevOps pipeline. My work focuses on automating security, ensuring compliance, and securing applications throughout their lifecycle.