I am trying to configure a VPC peering between my project network and another project using GCP, however I can't because I don't have permissions to list networks on the other project.
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"
}
The error:
Error 403: Required 'compute.networks.get' permission for 'projects/another-project/global/networks/another', forbidden
Since terraform doesn't have access to another-project I would like to know if there is any other way to do this with terraform.
Thank you in advance! :)
If you know the name of the peer network just add the location:
peer_network = "projects/PEER_PROJECT/global/networks/PEER_NETWORK"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With