Simplifying AWS Management: Harnessing the Power of the Command Line Interface (CLI)

Simplifying AWS Management: Harnessing the Power of the Command Line Interface (CLI)

Table of contents

No heading

No headings in the article.

In today's fast-paced and dynamic world of cloud computing, effective management of resources is crucial. Amazon Web Services (AWS) has revolutionized the way organizations build and scale their infrastructure.

While AWS offers a user-friendly web console, power users and automation enthusiasts often turn to the command line interface (CLI) for more efficient and streamlined management. In this blog post, we will explore how we can access AWS from the CLI and provide a step-by-step guide to get you started.

To set up the AWS CLI on Windows, follow these steps:

  1. Install the AWS CLI:

    • Download the AWS CLI installer for Windows from the official AWS Command Line Interface page: aws.amazon.com/cli.

    • Run the downloaded installer file (e.g., AWSCLIV2.msi).

    • Follow the installation wizard instructions. You can choose the default options or customize the installation directory as per your preference.

    • Select "Install" and wait for the installation process to complete.

  2. Configure AWS CLI Credentials:

    • Open the command prompt by pressing the Windows key + R, then type "cmd" and hit Enter.

    • To configure AWS CLI with your access credentials, run the following command:

        aws configure
      

      You'll be prompted to enter your AWS Access Key ID, Secret Access Key, default region name, and default output format. Obtain the access key and secret access key from the AWS Management Console:

      • Go to the AWS Management Console (console.aws.amazon.com).

      • Click on your username in the top-right corner, then select "My Security Credentials."

      • Under the "Access keys" section, click on "Create New Access Key" if you don't have one already.

      • Save the Access Key ID and Secret Access Key in a secure location.

      • For the default region name, enter the AWS region code (e.g., us-east-1).

      • For the default output format, you can leave it blank

      • Press Enter to confirm each value you enter.

    • Verify the AWS CLI installation:

      • To check if the AWS CLI is installed correctly, open a new command prompt and run the following command:

          aws --version
        
      • You should see the version of the AWS CLI installed.

    • You have successfully set up the AWS CLI on your Windows machine. You can now start using various AWS CLI commands to interact with your AWS resources from the command line.

    • For example, you can try running aws s3 ls to list your S3 buckets or aws ec2 describe-instances to retrieve information about your EC2 instances.

  3. Now to list down users using AWS CLI you can execute the following command

aws iam list-users

This will list down all the users you have created in the AWS and the output will resemble like the below

The command output will display the details of the IAM users in JSON format, including their usernames, unique user IDs, creation dates, and other relevant information.

The list-users command is just one example of how you can retrieve information using the AWS CLI. You can explore various other IAM-related commands and options in the AWS CLI documentation to manage IAM users and their permissions effectively.