[英]InvalidClientTokenId error aws when trying to get caller identity
hi I am unable to run this command aws sts get-caller-identity
.嗨,我无法运行此命令
aws sts get-caller-identity
。
when I do sudo nano ~/.aws/credentials
I can only locate this当我做
sudo nano ~/.aws/credentials
我只能找到这个
[default]
aws_access_key_id = my_id
aws_secret_access_key = my_secret_id
and after doing successful steps of command aws configure
when I am doing aws sts get-caller-identity
I am getting this error在我执行
aws sts get-caller-identity
时成功执行命令aws configure
步骤后,我收到此错误
An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.调用GetCallerIdentity操作时出错(InvalidClientTokenId):请求中包含的安全令牌无效。
any reason which could cause this?任何可能导致这种情况的原因?
Sometimes this kind of issues are caused by another credential configuration.有时这类问题是由另一个凭据配置引起的。
Environment variables credential configuration takes prority over credentials config file.环境变量凭证配置优先于凭证配置文件。 So in case there are present the environment variables "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY" or "AWS_SESSION_TOKEN" these could generate issues if it were missconfigured or have been expired.
因此,如果存在环境变量“AWS_ACCESS_KEY_ID”、“AWS_SECRET_ACCESS_KEY”或“AWS_SESSION_TOKEN”,如果配置错误或已过期,这些可能会产生问题。
Try checking the env vars associated to AWS Credentials and removing them using the 'unset' command in linux.尝试检查与 AWS 凭证关联的环境变量,并使用 linux 中的“取消设置”命令将其删除。
Additionally, to remove env vars permanently you need to remove the lines related on configuration files like:此外,要永久删除环境变量,您需要删除与配置文件相关的行,例如:
Reference:参考:
I had my default region disabled by default (eu-south-1), so I had to enable it via the Web console at first, then it worked.我默认禁用了我的默认区域(eu-south-1),所以我必须首先通过 Web 控制台启用它,然后它才起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.