Search code examples
amazon-web-servicesaws-cli

aws configure list show me nothing


Assume I am on a Mac and I have a ~/.aws/config file:

[profile cicd]
region = us-west-2
output = json

[profile prod]
region = us-west-2
output = json

And also a ~/.aws/credentials file:

[cicd]
aws_access_key_id = 12345 
aws_secret_access_key = 12345

[prod]
aws_access_key_id = 12345 
aws_secret_access_key = 12345

If I run:

aws configure list

I get:

      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

What have I done wrong?

Also, the company I work for has multiple AWS accounts. The cicd profile runs in one AWS account, and the prod runs in a different AWS account. A I supposed to record that fact in the AWS config files?


Solution

  • aws configure list just lists the current AWS credentials that you are using. It doesn't list all the available credentials you have configured on your system. The name of the command is really misleading.

    It is currently showing that you have no credentials configured, because you haven't done anything to specify that you want to use one of those profiles in your config/credential files.

    If you did something to select a profile, like:

    export AWS_PROFILE=cicd
    

    Then you would see some details about that particular profile when you run aws configure list.