【问题标题】:Terraform: Unable to Communicate with Google Cloud Platform InfrastructureTerraform:无法与谷歌云平台基础设施通信
【发布时间】:2021-11-05 16:56:40
【问题描述】:

我拥有最新的 Google Cloud Platform (GCP) Cloud SDK (gcloud):

gcloud version

#=>

Google Cloud SDK 356.0.0
beta 2021.09.03
bq 2.0.71
core 2021.09.03
gsutil 4.67

以及最新的 Terraform CLI (terraform):

terraform version

#=>

Terraform v1.0.6

已安装。当我尝试 applyplanrefresh 一个 Terraformed Google Kubernetes Engine (GKE) 集群时:

terraform plan -target=google_container_cluster.test

#=>

google_container_cluster.test: Refreshing state... [id=projects/. . ./test]
╷
│ Error: Error when reading or editing Container Cluster "test": Get "https://container.googleapis.com/v1beta1/projects/. . ./test?alt=json&prettyPrint=false": dial tcp [xxxx:xxxx:xxxx:xxx::xxx]:443: connect: no route to host
│
│   with google_container_cluster.test,
│   on container_cluster.tf line 1, in resource "google_container_cluster" "test":
│    1: resource "google_container_cluster" "test" {
│
╵

我遇到了上面的错误。

为什么?

【问题讨论】:

    标签: google-cloud-platform terraform terraform-provider-gcp


    【解决方案1】:

    似乎存在连接错误。如果您之前能够applyplanrefresh,则似乎没有任何错误配置。

    如果您能够解决独立于 Terraform 和 Cloud SDK 的外部连接问题,您应该能够再次将 Terraform 与远程 GCP 基础架构一起使用。

    Terraform 使用 REST 与 GCP 通信;例如,在上述错误中找到的路由是 Terraform 用于读取远程 GKE 集群的路由。您可以了解更多关于:

    没有路由到主机

    错误here

    【讨论】:

      猜你喜欢
      • 2019-06-10
      • 1970-01-01
      • 1970-01-01
      • 2019-05-26
      • 2020-06-02
      • 2020-06-08
      • 2020-01-11
      • 2017-12-08
      • 2020-01-11
      相关资源
      最近更新 更多