Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serverless Error: The security token included in the request is invalid

when i type serverless deploy appear this error: ServerlessError: The security token included in the request is invalid.

like image 217
Steven Giraldo Avatar asked Nov 16 '18 20:11

Steven Giraldo


People also ask

How do you fix the security token included in the request is invalid?

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.

How do I resolve the error the security token included in the request is expired?

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.

How do I install serverless offline?

Since you already know the basics of Serverless Framework, you must have installed the framework. Next, install the package serverless-offline from npm. 2. Add this installed plugin to your serverless project.

How do I install serverless?

Installing the Serverless Framework js. Open up a terminal and type npm install -g serverless to install Serverless.


2 Answers

I had to specify sls deploy --aws-profile in my serverless deploy commands like this:

sls deploy --aws-profile common

like image 160
Mikeumus Avatar answered Oct 22 '22 08:10

Mikeumus


Can you provide more information?

Make sure that you've got the correct credentials in ~/.aws/config and ~/.aws/credentials. You can set these up by running aws configure. More info here: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-quick-configuration

Also make sure that the IAM user in question has as an attached security policy that allows access to everything you need, such as CloudFormation.

like image 26
bwest Avatar answered Oct 22 '22 07:10

bwest