0

I have multiple profiles set up in my .aws\credentials file.

From the Windows 10 command line I have tried two approaches as per https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

aws cp s3://bucketname etc... --profile profile1

setx AWS_PROFILE profile1 aws cp etc...

Both cases give me "unable to locate credentials" on each file that is being uploaded to S3.

I use these profiles in Python with no issue.

This is the output of the "aws configure list" command:

C:\Users\nwalt>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                us-east-1      config-file    ~/.aws/config

but if I type "aws configure list --profile profile", then I see the profile name, and keys filled in.

NealWalters
  • 17,197
  • 42
  • 141
  • 251
  • Can you check for [this](https://stackoverflow.com/a/65848766/14843902) option related to setting the credentials file path variable as well. – amitd Jan 26 '21 at 15:50
  • @amitd - I'm not using a custom credentials file path, but the standard one. – NealWalters Jan 26 '21 at 17:24

1 Answers1

0

Turns out, I was not reading carefully. After adding the --profile profile1, the error changed to "access denied", which is something totally different.

I'm leaving the question though, because it might help someone see how to work with multiple profiles.

NealWalters
  • 17,197
  • 42
  • 141
  • 251