【发布时间】:2019-04-20 01:27:02
【问题描述】:
当我输入 serverless deploy 时出现这个错误: ServerlessError:请求中包含的安全令牌无效。
【问题讨论】:
标签: amazon-web-services amazon-iam serverless-framework serverless
当我输入 serverless deploy 时出现这个错误: ServerlessError:请求中包含的安全令牌无效。
【问题讨论】:
标签: amazon-web-services amazon-iam serverless-framework serverless
我必须在我的 serverless deploy 命令中指定 sls deploy --aws-profile,如下所示:
sls deploy --aws-profile common
【讨论】:
您能提供更多信息吗?
确保您在 ~/.aws/config 和 ~/.aws/credentials 中获得了正确的凭据。您可以通过运行aws configure 进行设置。更多信息在这里:https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-quick-configuration
还要确保相关 IAM 用户具有附加的安全策略,允许访问您需要的所有内容,例如 CloudFormation。
【讨论】:
在我的情况下,它缺少无服务器文件中的 localstack 条目。
我有所有应该在里面的东西,但它都在custom(而不是custom.localstack)里面。
【讨论】:
就我而言,我向提供程序添加了区域。我想它不是从凭证文件中读取的。
provider:
name: aws
runtime: nodejs12.x
region: cn-northwest-1
【讨论】: