[amazon-web-services] How can I resolve the error "The security token included in the request is invalid" when running aws iam upload-server-certificate?

I had similar issue when I was deploying my django application over elastic Beanstalk and what I found is when I was trying various methods somehow one eb-cli profile got created in config file in ~/.aws/ folder so once I got rid of that everything worked fine!!.