← All posts
3 min read

Install AWS CLI and configure your first profile

#aws#cloud#devops#cli
📑 On this page

Part 2 of AWS from Zero. Today we do the first real setup: install AWS CLI and prove that the terminal can talk to AWS.

The goal is not to create infrastructure yet. The goal is to make your local machine answer this question:

Which AWS account and identity am I using right now?

Install AWS CLI

Check whether it is already installed:

aws --version

If the command is missing, install AWS CLI v2 from the official AWS documentation for your operating system:

  • Windows: MSI installer
  • macOS: package installer or Homebrew
  • Linux: bundled installer

After installing, open a new terminal and run:

aws --version

You should see a version string that starts with aws-cli/2.

Configure a named profile

Avoid putting everything into the default profile when you are learning. Named profiles make commands more explicit.

aws configure --profile aws-zero

AWS CLI will ask for:

  • Access key ID
  • Secret access key
  • Default region
  • Default output format

For region, choose the region you want to learn in. I commonly use:

ap-south-1

For output format, use:

json

JSON is the native shape of AWS APIs, and it works beautifully with --query later.

Verify configuration

List the config AWS CLI sees:

aws configure list --profile aws-zero

This does not prove the credentials are valid. It only proves AWS CLI found them.

Now run the real identity check:

aws sts get-caller-identity --profile aws-zero

Expected shape:

{
  "UserId": "AIDA...",
  "Account": "123456789012",
  "Arn": "arn:aws:iam::123456789012:user/your-user"
}

That output is your first checkpoint. It tells you:

  • The AWS CLI can authenticate.
  • Which account you are in.
  • Whether you are using a user, role, or assumed role.

Make the profile easier to use

You can pass --profile aws-zero every time:

aws s3 ls --profile aws-zero

Or set an environment variable for the current terminal session:

export AWS_PROFILE=aws-zero

PowerShell version:

$env:AWS_PROFILE = "aws-zero"

Now commands use that profile automatically:

aws sts get-caller-identity

First tiny variation

Change only the output format:

aws sts get-caller-identity --output table
aws sts get-caller-identity --output yaml
aws sts get-caller-identity --output json

Same API call, different presentation.

In part 3, we learn how to explore AWS services from the terminal using help, --query, --filter, and output formats.