I cd
into the directory where all the pem/key files are and run the following:
aws iam upload-server-certificate
--server-certificate-name certificate_name
--certificate-body file://webservercertificate.pem
--private-key file://server.key
--certificate-chain file://certificate_chain_file.pem
I get the following error:
A client error (InvalidClientTokenId) occurred when calling the UploadServerCertificate operation: The security token included in the request is invalid.
I have 1 'user' in 'users'. That user has been assigned the following permissions:
IAMFullAccess IAMReadOnlyAccess IAMUserSSHKeys
I've downloaded the credentials for this user and put them into my user variables
AWS_ACCESS_KEY ****
AWS_SECRET_KEY ****
I have 1 role on my elastic beanstalk aws-elasticbeanstalk-ec2-role
The error "the Security Token included in the Request in Invalid" can occur for multiple reasons: The user's credentials are inactive. Open the IAM console, click on the user, and in the Security Credentials tab, make sure the security credentials of the user are active.
You must refresh the credentials before they expire. Another reason for expiration is using the incorrect time. A consistent and accurate time reference is crucial for many server tasks and processes. If your instance's date and time aren't set correctly, the AWS credentials are rejected.
If you're trying to reset your password and you receive an error citing an “invalid token” or asking you for your token, it's likely that the link you clicked on to reset your password has expired. For security reasons, passwords are never sent out across the Internet.
The value is either the serial number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials.
If you're using the CLI with MFA, you have to set the session token in addition to setting the access and secret keys. Please refer to this article: https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/
Try to go to the security credentials on your account page: Click on your name in the top right corner -> My security credentials
Then generate access keys over there and use those access keys in your credentials file (aws configure)
I had the same error, even after re-running aws configure
, and inputting a new AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
What fixed it for me was to delete my ~/.aws/credentials
file and re-run aws configure
.
It seems that my ~/.aws/credentials
file had an additional value: aws_session_token
which was causing the error. After deleting and re-creating the ~/.aws/configure
using the command aws configure
, there is now only values for aws_access_key_id
and aws_secret_access_key
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With