skip to Main Content

Image

I created a user in IAM service. and then I entered AWS configure command and entered user access key and secret key and region correctly. but the default account is not changing according to entered details. after that, I deleted .aws/credentials and aws/config. Also I reinstalled AWS cli. Without adding any user, still there can be seen default profile with access key, secret key and region.

I entered StackOverflow answer example access keys and secretkeys accidentally using setx keyword.

How to solve this problem?

When I give aws lambda list-functions, I get this error:

An error occurred (UnrecognizedClientException) when calling the ListFunctions operation: The security token included in the request is invalid.

2

Answers


  1. It appears that the AWS credentials set via Environment Variables are earlier in the ‘credentials provider chain’ than the credentials defined in local configuration files.

    To use the local configuration files, you will need to ‘unset’ the Environment Variables.

    See: How to Clear Environment Variables in Windows

    Login or Signup to reply.
  2. I also had similar issue with aws credentials not being cleared, so I ended up deleting RegisteredAccounts.json file in C:Users<user>AppDataLocalAWSToolkit.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search