Serverless Framework deploy through CircleCI

不羁岁月 提交于 2020-02-05 05:16:39

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/59431650/serverless-framework-deploy-through-circleci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!