在 aws -terraform 中使用凭证获取 accountid:getcalleridentity 时出错



我创建了一个 aws 账户和一个用于 terraform 管理员访问的 IAM 用户,并获得了我的凭证。 我现在正在尝试使用 terraform 在 AWS 中创建 EC2 实例。我正在从 git bash 运行下面的地形脚本。

provider "aws"{
access_key = "Axxxxxxxxx"
secret_key = "Lxxxxxxxxxxxxxx"
region="us-east-1"
}
resource "aws_instance" "example"{
ami="ami-0323c3dd2da7fb37d"
instance_type="t2.micro"
}

当我给出地形规划时,出现以下错误:

Error: error using credentials to get account ID: error calling sts:GetCallerIdentity: SignatureDoesNotMatch: Signature not yet current: 20200518T060344Z is still later than 20200518T041739Z (20200518T040239Z + 15 min.)
status code: 403, request id: 7d93e368-bf05-4110-9876-1bf6064dd255
on instance.tf line 1, in provider "aws":
1: provider "aws"{

我是 AWS 和 terraform 的新手。你能让我知道为什么会出现这个错误吗?我尝试更新 git bash。如果我错过了什么,请告诉我。

您的系统时钟可能配置错误。

来自此 AWS 论坛主题:

API 服务验证时间戳是否在实际时间的5 分钟内。如果系统时钟偏差超过5 分钟,则 API 请求将失败

最新更新