$ aws s3 ls
Could not connect to the endpoint URL: \"https://s3.us-east-1a.amazonaws.com/\"
What could be the problem?
Assuming that your profile in ~/aws/config is using the region (instead of AZ as per your original question); the other cause is your client's inability to connect to s3.us-east-1.amazonaws.com. In my case, I was unable to resolve that DNS name due to an error in my network configuration. Fixing the DNS issue solved my problem.