![](/img/trans.png)
[英]Error: “The security token included in the request is invalid” when using Boto python
[英]Serverless Error: The security token included in the request is invalid
当我键入 serverless deploy 时出现此错误:ServerlessError:请求中包含的安全令牌无效。
我必须在我的serverless deploy
命令中指定 sls deploy --aws-profile
,如下所示:
sls deploy --aws-profile common
你能提供更多信息吗?
确保您在~/.aws/config
和~/.aws/credentials
获得了正确的~/.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
要从 AWS 运行 function,您需要使用 access_key_id 和 secret_access_key 配置 AWS,但如果您想在本地运行 function,则可能会出现此错误,以便使用此命令
sls invoke local -f functionName
它将在本地而不是在 aws 上运行 function
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.