Manages a network peering within GCE. For more information see the official documentation and API.

Example Usage

resource "google_compute_network_peering" "peering1" {
  name = "peering1"
  network = "${google_compute_network.default.self_link}"
  peer_network = "${google_compute_network.other.self_link}"

resource "google_compute_network_peering" "peering2" {
  name = "peering2"
  network = "${google_compute_network.other.self_link}"
  peer_network = "${google_compute_network.default.self_link}"

resource "google_compute_network" "default" {
  name                    = "foobar"
  auto_create_subnetworks = "false"

resource "google_compute_network" "other" {
  name                    = "other"
  auto_create_subnetworks = "false"

Argument Reference

The following arguments are supported:

  • name - (Required) Name of the peering.

  • network - (Required) Resource link of the network to add a peering to.

  • peer_network - (Required) Resource link of the peer network.

  • auto_create_routes - (Optional) If set to true, the routes between the two networks will be created and managed automatically. Defaults to true.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • state - State for the peering.

  • state_details - Details about the current state of the peering.

© 2018 HashiCorpLicensed under the MPL 2.0 License.