无服务器:无法使用部署命令在 AWS 上加载 lambda 函数

Serverless: can't load lambda function on the AWS using deploy comand

我是无服务器框架的新手,我正在使用 official documentation 迈出我的第一步。而且我无法部署到 aws

y700@jekson:~/projects/awstest/numpy-test$ serverless deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...

  Serverless Error ---------------------------------------

  User: arn:aws:iam::6644331164204:user/lifeline-s3 is not authorized to perform: cloudformation:DescribeStacks on resource: arn:aws:cloudformation:us-east-1:6644331164204:stack/numpy-test-dev/*

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              8.10.0
     Framework Version:         1.58.0
     Plugin Version:            3.2.5
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

在 AWS 账户中,我创建了一个名为 serverless 的用户,具有 AdministratorAccess 权限,并使他成为无服务器框架默认用户 (serverless config credentials)。 在我还添加了具有以下权限的新策略之后:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "cloudformation:*",
            "Resource": "*"
        }
    ]
}

没有帮助。

但是奇怪的是在回溯中写着user/lifeline-s3,我无法理解这个用户来自哪里。

AWS CLI 正在从您的 shell 或 ~/.aws/credentials 文件中获取凭证。如果您希望无服务器和 AWS 使用默认值,请将 export AWS_PROFILE=default 添加到您的 .bashrc 或等效的 shell 配置文件。