I am using AWS Powershell and was recieving same error. When I logged into powershell to use the list s3 buckets command I kept getting
$ aws s3 ls
"Could not connect to the endpoint URL: "https://s3.us-east-1a.amazonaws.com/"
I made a few AWS default profiles within C:\Users\USERNAME\.aws Credentials file. From what I have gathered you are able to login and switch user profiles while in the same windows powershell session. Let's say for example in my credentials file I have 3 different profiles: test, test2, and account3
It seems you must specify the user profile in your command, since you have multiple profies setup in the credentials. Try adding your profile --profile
$ aws s3 ls --profile test
$ aws s3 ls --profile test1
$ aws s3 ls --profile account3
Get an in-depth understanding from the AWS Course in Bangalore.