1

I can run the AWS CLI aws configure command and it lists my credentials. I even have a named profile I use.

However, my system does not have Users\{profile}\.aws\credentials file. Where could my credentials be stored?

The following command returns this but ~/.aws/config is empty for all the accounts I have on this machine. I have hidden files shown.

$aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************BBBB             shared-credentials-file
secret_key     ****************BBBB             shared-credentials-file
    region                us-east-1      config-file    ~/.aws/config
  • Are you on Windows? That sounds quite unusual! The location should be `C:\Users\USERNAME\.aws\credentials`. Please note that directories starting with a dot _might_ be hidden on your system. Did you try putting putting the full path into a Text Editor to open the file, or perhaps navigating to that directory from the Command Line? Please tell us how you have verified that the `.aws` directory definitely does not exist. – John Rotenstein Aug 15 '22 at 22:50
  • The credential file should be stored under `%USERPROFILE%\.aws`, whatever that maps to on your system. – Anon Coward Aug 15 '22 at 22:56
  • What happens if you type `aws configure list`? It will enumerate values and where the file they're associated with is. – wkl Aug 15 '22 at 22:57
  • Be clear that there are two notions of profile here. The Windows environment variable named USERPROFILE e.g. `c:\users\chris` and the AWS configuration profile e.g. `[chris]`, stored in `%USERPROFILE%\.aws\credentials`. There is no such thing as `user\{profile}\.aws\credentials`. – jarmod Aug 15 '22 at 23:04
  • @wkl updated my answer with that info. – Chris Chevalier Aug 16 '22 at 00:57
  • Are you using WSL on Windows? WSL will have a different 'home' folder to native Windows. – jarmod Aug 16 '22 at 16:05

2 Answers2

0

As others pointed out the location of your AWS credentials should be in %USERPROFILE%\.aws

Follow these steps and let's see what you get

  1. Open terminal
  2. Run: cd %UserProfile%\.aws
  3. Run: type credentials

Another option is that you have added AWS_SHARED_CREDENTIALS_FILE environment variable. This changes the default location of the shared credentials file (https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#the-shared-credentials-file). Try these steps:

  1. Open terminal
  2. Run: echo %AWS_SHARED_CREDENTIALS_FILE%
  3. Run: type %AWS_SHARED_CREDENTIALS_FILE%
0

I have solved this creating a profile:

  1. aws configure --profile {profile-name}
  2. set any values
  3. The /.aws/ folder have been created and now you can edit their files.