- Newest
- Most votes
- Most comments
I'd suggest you to check the USERPROFILE
if you are configuring the Credentials in Windows.
Try to enter the user profile and remove the .aws/credentials, .aws/config
file and then you can try aws configure
again.
Let me share a sample powershell script.
$awsCredentialsFile = "$env:USERPROFILE\.aws\credentials"
$awsConfigFile = "$env:USERPROFILE\.aws\config"
aws configure set aws_access_key_id $AccessKeyId
aws configure set aws_secret_access_key $SecretAccessKey
aws configure set region us-east-1
Reply here how it goes.
Bhuvan
I'd start troubleshooting this by running following command, this is basically "whoami" of AWS:
aws sts get-caller-identity
Based on the output of this, you'll get to know which user it is using.
Though you have already mentioned this, but I'd print AWS access key and secret access key from the variable, which you are using. Make sure those values are not getting logged to some persistent logs.
Comment here how it goes, happy to be part of your troubleshooting.
Abhishek
Hi Abhishek, thanks for getting involved. I've run that command and it returns the account number and the user name that I've generated the access ID keys from, including the one that's currently running on my live site, so doesn't look like anything out of the ordinary there. What do you mean by making sure they're not getting logged to persistent logs? Thanks, Pete
No, I just wanted you to make sure that your access/secret key doesn't get logged somewhere from you can't delete it(just from security point)
What do you mean by "including the one that's currently running on my live site", could that be the problem? It should just return one identity. Sorry if I mistook you.
Sorry I just mean it's the account details that I used to create the access keys that are currently working on my live site, it does only return one identity.
Relevant content
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
Hi Bhuvan, This seems to have fixed it. I'd previously gone into the .aws\config file and made sure that the access key id and secret key matched what I had in the code and it didn't change anything. But this time on your recommendation I've completely deleted the files and run the aws configure again. Strangely enough, it even defaulted to the correct values, but after running aws configure it's now working. Thank you so much for your suggestion!