小编Flá*_*ira的帖子

Terraform GCP VPC 对等互连

我正在尝试使用 GCP 在我的项目网络和另一个项目之间配置 VPC 对等互连,但是我不能,因为我无权列出另一个项目上的网络。

resource "google_compute_network" "my-network" {
  name                    = "foobar"
  auto_create_subnetworks = "false"
}

resource "google_compute_network_peering" "my-network" {
  name         = "peering1"
  network      = "${google_compute_network.my-network.self_link}"
  peer_network = "${data.google_compute_network.another-network.self_link}"
}

data "google_compute_network" "another-network" {
  name    = "another"
  project = "another-project"
}
Run Code Online (Sandbox Code Playgroud)

错误:

Error 403: Required 'compute.networks.get' permission for 'projects/another-project/global/networks/another', forbidden
Run Code Online (Sandbox Code Playgroud)

由于 terraform 无法访问,another-project我想知道是否有其他方法可以使用 terraform 执行此操作。

先感谢您!:)

vpc terraform-provider-gcp

2
推荐指数
1
解决办法
1019
查看次数

标签 统计

terraform-provider-gcp ×1

vpc ×1