Thu Sep 30 2021·2 min read
Photo by Ansgar Scheffold
In order to see which your default AWS CLI profile is, run the
aws configure list command. The command shows the name of the default profile,
the profile's security credentials and region.
aws configure list
In the example above, we can see that the default profile's name is
The configure list command also shows where the name of the default profile is set.
In this case the name of the default profile is set using the
environment variable, which has higher precedence than the settings in the
You can find the
Access Key ID and
Secret Access Key of the profile in the
# on Linux and macOS ~/.aws/credentials # on Windows C:\Users\USERNAME\.aws\credentials
region and CLI
output format for the profile are stored in the
file in the same directory:
# on Linux and macOS ~/.aws/config # on Windows C:\Users\USERNAME\.aws\config
When an AWS CLI command is invoked it looks for your credentials in:
Command line options - have the highest precedence and override any
environment variables or configuration stored in
The command line options are:
Environment variables on the machine - have higher precedence than the
credentials files but get overridden by command line options.
The environment variables are:
credentials files on your machine - have the lowest
precedence - lower than environment variables and command line options.
Locationcolumn when calling
aws configure list.
If the command's output shows that the
Type is set to env and the
is an environment variable, then it gets higher precedence than the values
you've specified in your
To verify whether an Environment variable is set on your machine, run the
command that corresponds to your operating system:
# Linux and macOS echo $AWS_PROFILE # on Windows with CMD echo %AWS_PROFILE% # on Windows with PowerShell echo $Env:AWS_PROFILE
aws s3 ls --profile tester.
If you want to change your default profile, check out my other article - Set your Default Profile's Name in AWS CLI .
I'll send you 1 email a week with links to all of the articles I've written that week