Search code examples
serverless-frameworkcircleci

Serverless Framework deploy through CircleCI


I'm trying to integrate serverless to my circleci workflow. I tried first adding both, key and secret to AWS permissions, but that did not work. Then, I added key and secret to Environment variables and in my config file:

sudo npm install -g serverless
sls config credentials --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_ACCESS_KEY
sls deploy -v

But I see the same error:

Serverless Error ---------------------------------------
You are not currently logged in. Follow instructions in http://slss.io/run-in-cicd to setup env vars for authentication.

Anyone had this issue? I could not find an answer or hint online. Thanks.


Solution

  • Just checked Circleci stopped supporting AWS Permissions as a configurable option in the settings page.

    You need to set the credentials as environment variables for the projects. The credentials should be named exactly AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

    that's all you need to do. you don't have to do any additional step. I tried this on my project and it worked.

    Your deployment step should simply be

    sls deploy