繁体   English   中英

请求中包含的 aws sam 无效令牌无效

[英]aws sam invalid token included in the request is invalid

我正在使用 aws sam 以及何时尝试进行 sam 部署。 我收到此错误:

Error: Failed to create managed resources: An error occurred (InvalidClientTokenId) when calling the CreateChangeSet operation: The security token included in the request is invalid. 

我已经从.aws 更改了我的凭据,并使用命令 aws configure 更改了它们。 当我尝试在线访问任何内容时,我也会收到错误消息,例如我尝试将文件上传到 S3 存储桶。

Error: botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the UpdateItem operation: The security token included in the request is invalid.

有任何想法吗?

您需要检查是否在~/.aws/credentials文件中设置了默认凭据,如果您有多个并且没有在共享凭据文件中指定默认值,而且您在环境 sam cli 中没有设置任何内容将因上述消息而失败。

您使用文档来设置它们

当我收到“请求中的令牌无效”时,我的具体解决方案是:

  1. 我尝试使用与默认配置不同的配置文件,将默认配置更新为我想要运行的配置文件
  2. 根据需要使用默认设置启动“sam init”,并且在从 init 到 build 到 deploy 时不要进行更改。 文档说明为键设置 env var,但尚未尝试过。

我猜您的凭据没问题,但是请再次检查您是否指向正确的region 那确实是我的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM