Thuta Learning
BasicDevOpsbeginner

AWS CLI Basics

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand AWS CLI Basics without the intimidation
  • Be able to run the AWS CLI/Console yourself
  • Apply this concept immediately in a real project

Let's think about this for a second

The AWS Console is a browser-based UI — great for visually inspecting things, but manually clicking through repetitive tasks (like creating 10 servers) gets tedious fast. Once you install and configure the AWS CLI, you can manage AWS resources from the command line using the `aws <service> <command>` pattern — and you can drop it straight into scripts to automate things. Running `aws configure` walks you through setting up your Access Key ID, Secret Access Key, default Region, and output format (using credentials obtained from an IAM User).

Let's connect this to a real scenario

Run `aws s3 ls` and it lists every S3 bucket in your account — no need to open the Console and click around. Terraform (covered in another tutorial) also uses the AWS CLI/SDK under the hood to call the AWS API — the more familiar you are with the CLI, the easier Terraform's error messages will be to understand too.

Let's look at it together

bash
# Configure the CLI with your IAM user's credentials
aws configure

# List S3 buckets
aws s3 ls

# List EC2 instances
aws ec2 describe-instances

# Check which identity the CLI is using
aws sts get-caller-identity
You should see
$ aws sts get-caller-identity
{
    "UserId": "AIDAEXAMPLE123",
    "Account": "123456789012",
    "Arn": "arn:aws:iam::123456789012:user/developer-1"
}

5-minute try-it

Install the AWS CLI, run `aws configure`, and set it up with an IAM User's credentials — then run `aws sts get-caller-identity` to confirm it's showing the right identity.

A quick word of caution

Keep in mind that `~/.aws/credentials` stores your access key in plain text — if your laptop is shared or public, that file could be exposed, so disk encryption is worth turning on.

Easy traps

  • Configuring the CLI with Root User access keys — you should only ever use an IAM User (least privilege) instead
  • Sharing `aws configure` credentials with multiple team members — each person should have their own dedicated IAM User

Now try it yourself

Install the AWS CLI, run `aws configure`, and set it up with an IAM User's credentials — then run `aws sts get-caller-identity` to confirm it's showing the right identity.

You'll know it worked when: $ aws sts get-caller-identity { "UserId": "AIDAEXAMPLE123", "Account": "123456789012", "Arn": "arn:aws:iam::123456789012:user/developer-1" }

AWS CLI Basics | Thuta Learning