Sitemap

AWS CLI Tips & Tricks

2 min readNov 24, 2025

--

Once you have installed the AWS CLI locally or have access to the cloudshell, you can go ahead and configure the user credentials.

Profiles can be used to store different user/account credentials for when working with multiple clients and not having to create a configuration file every time you log in.

Configure profile

aws configure - profile <user_name>

Verify configuration
aws sts get-caller-identity is the whoami command in AWS. Always check before working in an environment to make sure you’re in the right account, especially when working with multiple client accounts.

aws sts get-caller-identity --profile <user_name>

Notice that when you use the aws sts get-caller-identity command you get the same result. That’s because the profile is for the same user, and there aren’t multiple users for this profile. However, profiles are great for multiple users/roles and accounts.

Get Ronna Curelea’s stories in your inbox

Join Medium for free to get updates from this writer.

The benefits of using profiles:

  • Multiple accounts:
    Keep credentials for different AWS accounts separate
  • Different roles: Switch between user credentials and role-based access
  • Environment separation:
    Use different profiles for dev, staging, and production

Instead of always typing --profile <user_name>, you can set it as an environment variable, and just use aws sts get-caller-identity directly going forward.

export AWS_PROFILE=user-name

aws sts get-caller-identity

AWS provides in-depth documentation for their CLI

https://docs.aws.amazon.com/cli/latest/reference/

To see all the s3 bucket commands you can use, grep it.

aws s3api help | grep -i bucket

Now let’s list some buckets.

aws s3api list-buckets
Press enter or click to view image in full size

Let’s try to see their contents.

aws s3 ls s3://cli-tips-bucket-.....  

--

--