繁体   English   中英

Terraform 在与 AWS 服务对话时返回“i/o 超时”错误

[英]Terraform returns “i/o timeout” error when speaking to AWS services

当我执行任何需要 Terraform 与 AWS 服务对话的操作时,我会收到此类错误:

Error: error configuring Terraform AWS Provider: IAM Role (arn:aws:iam::12345678910:role/terraform-role) cannot be assumed.
│
│ There are a number of possible causes of this - the most common are:
│   * The credentials used in order to assume the role are invalid
│   * The credentials do not have appropriate permission to assume the role
│   * The role ARN is not valid
│
│ Error: operation error STS: AssumeRole, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sts.us-east-1.amazonaws.com/": dial tcp: lookup sts.us-east-1.amazonaws.com on 1.1.1.1:53: read udp 192.168.1.246:0->1.1.1.1:53: i/o timeout
│
│
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on main.tf line 13, in provider "aws":
│   13: provider "aws" {

到目前为止我测试过的内容:

  1. 另一台连接到同一网络并安装了相同软件版本的 Macbook 运行良好。
  2. 切换到另一个网络没有帮助。
  3. 尝试使用互联网提供商的 DNS 服务器(192.168.1.1),使用 Google 的(8.8.8.8),使用 CloudFlare 的(1.1.1.1) - 没有区别。
  4. 命令dig @1.1.1.1 sts.us-east-2.amazonaws.com工作得很好。
  5. AWS CLI 可以毫无问题地与 STS 对话。
  6. 如果我在容器中运行 Terraform,并将我的 AWS 凭证挂载为卷,它就可以正常工作。 所以问题只是当我通过本地终端运行它时。
  7. 尝试了不同版本的 Terraform,即 1.2.5、1.0.0 和 1.0.3 - 没有区别。

我的想法用完了,请帮忙吗?

版本:

macOS Monterey, version 12.5
Terraform v1.2.5
aws-cli/2.0.30 Python/3.7.4 Darwin/21.6.0 botocore/2.0.0dev34
Go runtime version: go1.18.1

我是公司安装的VPN软件的问题。 删除后,问题就消失了。

暂无
暂无

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

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