
The aws configure list command can be used to display the basic configuration you have set for the aws command line tool.
In this example, no configurations have been set.
~]$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region <not set> None None
If the --profile option is not used, the default configurations will be listed. The --profile option can be used to display the configurations of a particular profile.
~]$ aws configure list --profile johndoe
Name Value Type Location
---- ----- ---- --------
profile johndoe manual --profile
access_key ****************MI3W shared-credentials-file
secret_key ****************SL9l shared-credentials-file
region us-east-1 config-file ~/.aws/config
aws configure set can be used to set certain configurations, such as region.
aws configure set default.region us-east-2
aws configure set region us-east-1 --profile development
aws configure set region us-east-2 --profile staging
aws configure set region us-east-2 --profile production
And output format.
aws configure set default.output json
aws configure set output json --profile development
aws configure set output json --profile staging
aws configure set output json --profile production
This should create a config file with matching key value pairs.
~]$ cat /home/john.doe/.aws/config
[default]
region = us-east-2
output = json
[profile development]
region = us-east-1
output = json
[profile staging]
region = us-east-2
output = json
[profile production]
region = us-east-2
output = json
You can also set your access key. You can get your access key in the AWS console at IAM (Identity and Access Management) > Manage access keys.
To create your access key, sign into the AWS console with your ID, at the top right select your name > Security credentials > Create access key.
aws configure set default.aws_secret_access_key Xw3kZVaxTfvDKBMGf6R79Unf5LG4kdf9piuHfhn13
aws configure set aws_secret_access_key Xw3kZVaxTfvDKBMGf6R79Unf5LG4kdf9piuHfhn13 --profile development
aws configure set aws_secret_access_key fmG74A8cAXa96LWrWw1dkm565bgAtPvMy6yfjm2s --profile staging
aws configure set aws_secret_access_key fj1a5YG2rGYzE99Ccdfhn#RQaU4pZ+H3ehFgm567 --profile production
And key ID.
aws configure set default.aws_access_key_id 34VGB4HYOC2ABCO67BKD
aws configure set aws_access_key_id 34VGB4HYOC2ABCO67BKD --profile development
aws configure set aws_access_key_id 34CDSCNDE3E675K67BKD --profile staging
aws configure set aws_access_key_id ZMKF1MMUDGUZR7XFJM90 --profile production
This should create a credentails file with matching key value pairs.
~]$ cat /home/john.doe/.aws/credentials
[default]
aws_secret_access_key = Xw3kZVaxTfvDKBMGf6R79Unf5LG4kdf9piuHfhn13
aws_access_key_id = 34VGB4HYOC2ABCO67BKD
[development]
aws_secret_access_key = Xw3kZVaxTfvDKBMGf6R79Unf5LG4kdf9piuHfhn13
aws_access_key_id = 34VGB4HYOC2ABCO67BKD
[staging]
aws_secret_access_key = fmG74A8cAXa96LWrWw1dkm565bgAtPvMy6yfjm2s
aws_access_key_id = 34CDSCNDE3E675K67BKD
[production]
aws_secret_access_key = fj1a5YG2rGYzE99Ccdfhn#RQaU4pZ+H3ehFgm567
aws_access_key_id = ZMKF1MMUDGUZR7XFJM90
And now the aws configure list command should have values set.
]$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************7BKD shared-credentials-file
secret_key ****************hn13 shared-credentials-file
region us-east-2 config-file ~/.aws/config
The --profile option can be used to show the configuration for a particular profile.
~]$ aws configure list --profile personal
Name Value Type Location
---- ----- ---- --------
profile personal manual --profile
access_key ****************MI3W shared-credentials-file
secret_key ****************SL9l shared-credentials-file
region <not set> None None
Did you find this article helpful?
If so, consider buying me a coffee over at