'Elastic Beanstalk CLI security token issues
I'm running the EBLCI on Ubuntu. It's pretty slick most of the time but I keep getting kicked out for some kind of security issues. I keep getting the following error:
ERROR: NotAuthorizedError - Operation Denied. The security token included in the request is invalid.
I was able to fix it last week by creating a new IAM key pair and manually inputting the keys into the aws config file in ~.aws/credentials.
This time that didn't work. Any ideas?
Solution 1:[1]
Check the ~/.aws/credentials file again. When you don't have the default profile, AWS CLI will return this error. This could also occur if you have an IAM role attached to the EC2 instance and you don't specify the --profile option in your command.
You can try exporting the credentials as mentioned in this document and try the command again.
Solution 2:[2]
I've just had this issue, in my case, we'd revoked the AWS key (as is our policy) and forgotten to set up the new one with my machine. Try revoking the previous key (if it's not already), and setting up a new one.
Solution 3:[3]
Just had this problem because I had updated my AWS password. I created new Access Keys for my AWS account under Security Credentials and copied the new access key and secret access key to the config and credentials files in the .aws folder (located in C:\Users\username.aws).
Solution 4:[4]
You can delete old access keys and create new access keys, which may resolve the issue. To do this:
- log in to IAM console: https://console.aws.amazon.com/iamv2/home#/home
- select 'My Security Credentials': https://console.aws.amazon.com/iam/home#/security_credentials
- expand ->Access keys (access key ID ...)
- delete old access key, create new access key
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | krishna_mee2004 |
| Solution 2 | Dave Roberts |
| Solution 3 | leelum1 |
| Solution 4 | edW |
