amazon-web-services - 在 aws -terraform 中使用凭证获取 accountid:getcalleridentity 时出错
问题描述
我为 terraform -administrator 访问创建了一个 aws 帐户和一个 IAM 用户并获得了我的凭证。我现在正在尝试使用 terraform 在 AWS 中创建 EC2 实例。我正在从 git bash 运行以下 terraform 脚本。
provider "aws"{
access_key = "Axxxxxxxxx"
secret_key = "Lxxxxxxxxxxxxxx"
region="us-east-1"
}
resource "aws_instance" "example"{
ami="ami-0323c3dd2da7fb37d"
instance_type="t2.micro"
}
当我给出 terraform 计划时,出现以下错误:
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。如果我遗漏了什么,请告诉我。
解决方案
推荐阅读
- javascript - 如何添加加载更多按钮以使用 jquery 或 ajax 在我的 django 项目模板中显示更多评论?
- install4j - 在 mac 和 linux 上 Install4j 后台更新程序失败
- c - 尝试使用 malloc 做 3 维矩阵
- mysql - 当我试图在 xampp 中启动 MySQL 时。我收到此错误
- c# - 允许 EFCore [必需]-Attribute 可以为空
- python - Robotframework:找不到自定义库方法关键字
- sql - 如何使用 apex_200100.www_flow_t_varchar2 作为 int 或 char
- ruby - 如何将哈希转换为字符串哈希?
- flutter - 单击另一个文本字段时,颤振文本字段值消失
- kubernetes - 为什么 kubernetes 默认服务帐号可以完全访问 docker 桌面上的 API?