- Newest
- Most votes
- Most comments
Hello.
Are you running the command on your local Windows PC?
Can you confirm that the access key settings are read from the credential file when you run the command below?
aws configure list
Below is an example of the response when the command is executed.
If the type column is "env", it is read from environment variables, so please check if the environment variables of your Windows PC are set.
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************ABCD shared-credentials-file
secret_key ****************EDGH shared-credentials-file
region us-east-2 config-file ~/.aws/config
It sounds like your AWS CLI is still pulling credentials from an older session, even after updating your config. A couple of things to check: Run aws sts get-caller-identity again after clearing any environment variables: bash Copy Edit unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN Make sure you’re using the correct profile:
bash Copy Edit aws iam list-users --profile your-new-profile If you're still seeing old users, double-check that the access keys you used actually belong to the new account — not a reused IAM user.
Also, remember that IAM users are account-specific — you won’t see users from one root account in another, even if the email addresses or names are similar.
Relevant content
- asked a year ago
Hi Riku, The response of the 'aws configure list' on my Windows PC Name Value Type Location ---- ----- ---- -------- profile ga****-**** env ['AWS_PROFILE', 'AWS_DEFAULT_PROFILE'] access_key ****************7YGU env secret_key ****************8DI5 env region us-east-1 env ['AWS_REGION', 'AWS_DEFAULT_REGION']
However, these access_key and secret_key is not matching the one created with new root-user account. Looks like these are from previous aws account.
Thank you for confirmation. Access keys have an order in which they are loaded, and if they are set in an environment variable, they will be loaded first. In your case, the access key is read from the environment variable, so please check whether the access key is set in the environment variable of the Windows PC. If it is set as an environment variable, delete it and it will be read from the credentials file.
Hi Riku, Thanks for advice! Removing the aws access_key system environments, i can able to see the correct users